main = do
  s <- getLine
  putStr . max $ [(k . f c) s | c <- ['a' .. 'z']]
  
f c cs = map g c $ cs
g c d
  | c == d = 1
  | otherwise = 0 

h n xs
  | n >= length xs = 0
  | xs !! n == 1 = 1 + h (n+1) xs
  | otherwise = 0

k xs = max [h n xs | n <- [0 .. ((length xs) - 1)]]
  