SP4532 STREDUCE - String reduction

Description

[English](/problems/STREDUCE/en/) [Tiếng Việt](/problems/STREDUCE/vn/)Given a string containing only characters of 'a' and 'b'. You can reduce this string by replacing a substring forming a?a or b?b by ?; ? is 'a' or 'b'.

Input Format

\- A string.

Output Format

\- The minimum length found.