POST CONTEST : Help in question NASDAQ intern hiring question

I have given NASDAQ intern hiring test on hacker earth.
Out of 2 I couldn’t solve the second question. I need help regarding how to approach this type of question
Question was : > given a binary string : consisting of only zeroes and ones

At each step we can remove alternating subsequence from the string
Alternating subsequence is defined as “01010…” , “101…” , “01…” , “10…”
Note that “100” and “0111” are not alternating subsequences.
We have to minimize the number of steps to reduce the binary string to empty string.

Test Case : " 0100100111"
Output : 3