import std.algorithm, std.container, std.conv, std.math, std.range, std.typecons, std.stdio, std.string;

auto rdsp(){return readln.splitter;}
void pick(R,T)(ref R r,ref T t){t=r.front.to!T;r.popFront;}
void readV(T...)(ref T t){auto r=rdsp;foreach(ref v;t)pick(r,v);}

void main()
{
  int n, k; readV(n, k);
  string s; readV(s);

  auto a = s.chunkBy!"a == b".map!(c => cast(int)c.walkLength).array;
  if (s[0] == '0') a = 0 ~ a;

  auto ac = a.cumulativeSum, r = 0;

  for (auto i = 0; i < a.length; i += 2)
    r = max(r, ac[i..min(i+k*2+1, a.length)]);

  writeln(r);
}

class CumulativeSum(T)
{
  size_t n;
  T[] s;

  this(T[] a)
  {
    n = a.length;
    s = new T[](n+1);
    static if (T.init != 0) s[0] = T(0);
    foreach (i; 0..n) s[i+1] = s[i] + a[i];
  }

  pure auto opSlice(size_t l, size_t r) { return s[r]-s[l]; }
  pure auto opDollar() { return n; }
}
auto cumulativeSum(T)(T[] a) { return new CumulativeSum!T(a); }
