Company: mastercard_1aug
Difficulty: hard
Minimum Turns to Print a String A printer starts with a blank string of the required length. In one turn, it chooses a lowercase letter and a non-empty contiguous interval, then writes that letter into every position of the interval, overwriting any characters already there. Given the target string S , find the minimum number of turns needed to print it. Input One line contains S . Output Print the minimum number of turns. Constraints 1 <= |S| <= 100 S contains only lowercase English letters. Examples Input: aaxaxxya Output: 4 Input: xxccaa Output: 3 Notes The interval chosen in a turn may cover positions that will be overwritten in later turns.