A palindrome is a word that reads the same forward and backward. For example, add is not a palindrome, because reading it backward gives dda. If you reorder its letters, however, you get dad, which is a palindrome.
A word that is an anagram of at least one palindrome is called a Peragram. An anagram of a word w contains exactly the same letters as w in the same quantities, possibly in a different order. In the example above, add is a Peragram, because it is an anagram of the palindrome dad.
You are given a string. Find the minimum number of letters you have to remove from it so that it becomes a Peragram.
The first line contains a string. Its length is between 1 and 1000 characters, and it uses only the lowercase letters a to z.
Print, on a single line, the minimum number of letters that have to be removed to make the string a Peragram.