Multiple sets of input.
Each group just one line, s, represents the menu sequence.All the letters are uppercase and within
{A,B,C,D,E,F,G,H,I,J}. 1≤|s|≤1e5。
输出描述:
Output an integer indicating the minimum amount of time you need to spend planting.
输入输出样例
输入样例#:
EIGJBB
输出样例#:
复制
9
提示
The sample explain:
farm planting situation (The serial number 1 indicates the ingredient grown on the earliest farmland,
the serial number 2 indicates the second earliest, and the serial number 3 indicates the latest) :
1 2 3
a b b
b c c
c c c
c a b
a b a
a b a
The order in which ingredients are grown: abbcccaba.