#C5016. Taco String Reduction

    ID: 48619 Type: Default 1000ms 256MiB

Taco String Reduction

Taco String Reduction

Given a string s consisting only of lowercase Latin letters, perform the following reduction operation: repeatedly remove any pair of adjacent characters that are identical. The process is repeated until no such adjacent pair exists.

Formally, if there exists an index i such that \(s[i] = s[i+1]\) (in \(\LaTeX\) format), remove the two characters and concatenate the remaining parts. The residual string is unique regardless of the order of removals.

Your task is to compute and output the length of the resulting string after performing all possible reduction operations.

inputFormat

The input is given on a single line from standard input, containing the string s (1 ≤ |s| ≤ 105), made up of lowercase Latin letters.

outputFormat

Output a single integer on a line by itself: the length of the string after all possible reduction operations have been performed.

## sample
abbac
1

</p>