Palindromic Length
문제
A string is called a palindrome if it is read the same forward and backward. Palindromes are useful factors for measuring the complexity of strings like the asymmetry of the strings. The asymmetry of a string of length can be measured by its palindromic length, , which is the minimum number of palindrome substrings into which can be partitioned. More precisely, is the minimum number (1 ≤ t ≤ n) such that there exist palindrome substrings whose concatenation becomes . To make it easier to distinguish, we denote a partition of into as | | | .
For example, a string abaaca can be partitioned into two palindrome substrings as aba | aca, that is the minimum, so abaaca. A string acaba cannot be partitioned into two palindrome substrings, but it can be partitioned into three palindrome substrings, aca | b | a or a | c | aba, so acaba. For radar, because is a palindrome. for abcde.
Given a non-empty string of English lowercase letters, write a program to output .
입력
Your program is to read from standard input. The input starts with a line containing a positive integer (1 ≤ n ≤ 100\,000), where is the number of letters of a string. The next line contains a string of English lowercase letters. Note that the string contains no space between the letters.
출력
Your program is to write to standard output. Print exactly one line. The line should contain a positive integer which is the palindromic length of the input string .
예제
예제 1
6 abaaca
2
예제 2
5 acaba
3
예제 3
5 abcde
5
예제 4
5 radar
1