You are given a string $$$s$$$ consisting only of uppercase English letters. In one operation, you may remove any occurrence of the substring "AB" or "CD" from $$$s$$$.
After removal, the remaining parts of the string concatenate, which may create new occurrences of "AB" or "CD".
Determine the minimum possible length of the string after applying zero or more such operations optimally.
A single line containing the string $$$s$$$.
Print a single integer: the minimum length of the string obtainable after performing the removals.
Input:
AXBYCDZC
Output:
6
Input:
ACABDB
Output:
0
In the first testcase,
In the second testcase,