A squared word is a word of the form xx, that is, some string of letters written twice in a row. For example, the English words couscous, murmur (a low, continuous sound), tartar (hardened dental plaque), and hotshots are squared words.
Given a word, you may delete some of its letters so that what remains is a squared word. The result does not have to be a real English word. Deleting letters keeps the remaining letters in their original order. Find the minimum number of letters that must be deleted.
The first line contains an integer n (1≤n≤1000), the length of the word. The second line contains a word made of n lowercase English letters.
Print a single integer: the minimum number of letters that must be deleted so that the word becomes a squared word. The empty word counts as a valid squared word.
For example, deleting y, s, o, s, k, o, and p from tachystoskopach leaves the squared word tachtach. (In Polish, tachtach is a little-known kind of coach.)