#C11764. Final String Length After Removing Consecutive Characters

    ID: 41116 Type: Default 1000ms 256MiB

Final String Length After Removing Consecutive Characters

Final String Length After Removing Consecutive Characters

Given a string s, perform the following operation repeatedly: if two adjacent characters in the string are equal, remove them simultaneously. Continue applying this process until no such adjacent equal characters remain. Your task is to output the final length of the string after all possible removals.

This process can be thought of as repeatedly removing any substring of the form $$xx$$ (where x is any character) until there is no such substring left. For example, for the input abba the removals result in an empty string, and the final length is 0.

inputFormat

The input consists of a single line containing the string s.

Note: The string can be empty or consist only of lowercase English letters.

outputFormat

Output a single integer representing the length of the final string after performing all consecutive removals.

## sample
abba
0

</p>