{"problem":{"name":"Cut and Count","description":{"content":"You are given a string $S$ of length $N$ consisting of lowercase English letters. We will cut this string at one position into two strings $X$ and $Y$. Here, we would like to maximize the number of di","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc098_b"},"statements":[{"statement_type":"Markdown","content":"You are given a string $S$ of length $N$ consisting of lowercase English letters. We will cut this string at one position into two strings $X$ and $Y$. Here, we would like to maximize the number of different letters contained in both $X$ and $Y$. Find the largest possible number of different letters contained in both $X$ and $Y$ when we cut the string at the optimal position.\n\n## Constraints\n\n*   $2 \\leq N \\leq 100$\n*   $|S| = N$\n*   $S$ consists of lowercase English letters.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$\n$S$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc098_b","tags":[],"sample_group":[["6\naabbca","2\n\nIf we cut the string between the third and fourth letters into $X =$ `aab` and $Y =$ `bca`, the letters contained in both $X$ and $Y$ are `a` and `b`. There will never be three or more different letters contained in both $X$ and $Y$, so the answer is $2$."],["10\naaaaaaaaaa","1\n\nHowever we divide $S$, only `a` will be contained in both $X$ and $Y$."],["45\ntgxgdqkyjzhyputjjtllptdfxocrylqfqjynmfbfucbir","9"]],"created_at":"2026-03-03 11:01:14"}}