#C8265. Longest Palindrome

    ID: 52228 Type: Default 1000ms 256MiB

Longest Palindrome

Longest Palindrome

Given a string s, determine the length of the longest palindrome that can be constructed using the characters of s. A palindrome is a string that reads the same backward as forward. You are allowed to rearrange the characters of the string. The answer is the maximum number of characters that can form a palindrome.

In mathematical terms, if you count the frequency of each character in s as \(f(c)\), the answer is given by:

\[ \text{result} = \sum_{c} \left( f(c) - (f(c) \bmod 2) \right) + \mathbb{1}_{\{\exists c: f(c) \bmod 2 = 1\}} \]

where \(\mathbb{1}_{\{\exists c: f(c) \bmod 2 = 1\}}\) is 1 if there is at least one character that occurs an odd number of times, and 0 otherwise.

inputFormat

The input consists of a single line containing the string s. The string will contain only lowercase English letters.

outputFormat

Output a single integer representing the maximum length of a palindrome that can be built with the characters from the given string.

## sample
a
1