main = print . count . diff <$> getLine

diff [_] = []
diff (x:y:zs) = (x /= y) : diff (y:zs)

count xs = go 0 0 xs
  where
    go k n [] = k `max` n
    go k n (True:xs) = go (k `max` n) 0 xs
    go k n (False:xs) = go k (n + 1) xs
