<s> """<STR_LIT>""" <EOL> __author__ = '<STR_LIT>' <EOL> class Solution ( object ) : <EOL> def solve ( self , cipher ) : <EOL> """<STR_LIT>""" <EOL> lst = list ( cipher ) <EOL> ret = [ lst [ <NUM_LIT:0> ] ] <EOL> cnt = <NUM_LIT:0> <EOL> for i in xrange ( <NUM_LIT:1> , len ( lst ) ) : <EOL> if lst [ i ] != ret [ - <NUM_LIT:1> ] : <EOL> ret . append ( lst [ i ] ) <EOL> else : <EOL> cnt += <NUM_LIT:1> <EOL> return cnt <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> import sys <EOL> f = open ( "<STR_LIT>" , "<STR_LIT:r>" ) <EOL> solution = Solution ( ) <EOL> testcases = int ( f . readline ( ) . strip ( ) ) <EOL> for t in xrange ( testcases ) : <EOL> cipher = f . readline ( ) . strip ( ) <EOL> s = "<STR_LIT>" % ( solution . solve ( cipher ) ) <EOL> print s , </s>
