import Data.Char(digitToInt)
main = do
  nkIn <- getLine
  slsIn <- getLine
  let
    [n,k] = map read $ words nkIn :: [Int]
    state = func1 slsIn '-' 0 []
    header = digitToInt $ head slsIn
    ans = func2 state state header header k 0 0
    func1 slsIn prev contLen ret
      | slsIn == []        = tail (reverse (contLen:ret))
      | head slsIn == prev = func1 (tail slsIn) prev (contLen+1) ret
      | otherwise          = func1 (tail slsIn) (head slsIn) 1 (contLen:ret)
    func2 state1 state2 hd1 hd2 k temp ret
      | state1 == []                               = (max temp ret)
      | hd1 == 1                                   = func2 (tail state1) state2 0 hd2 k (temp+(head state1)) (max temp ret)
      | hd1 == 0 && k > 0                          = func2 (tail state1) state2 1 hd2 (k-1) (temp+(head state1)) (max temp ret)
      | hd1 == 0 && k <= 0 && hd2 == 1             = func2 state1 (tail state2) hd1 0 k (temp-(head state2)) (max temp ret)
      | hd1 == 0 && k <= 0 && hd2 == 0             = func2 (tail state1) (tail state2) 1 1 k (temp+(head state1)-(head state2)) (max temp ret)
      | otherwise  = -1
    in
      putStrLn $ show ans
