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

void main() {

	auto data = readln.split.to!(int[]);
	auto N = data[0], K = data[1];
	auto S = readln.split[0];
	
	auto groupS = S.group().array;
	if (groupS[0][0] == '0')   groupS = [tuple('1'.to!dchar, 0.to!uint)] ~ groupS;
	if (groupS[$-1][0] == '0') groupS ~= tuple('1'.to!dchar, 0.to!uint);
	
	if ( 2*K + 1 > groupS.length ) { S.length.writeln; return; }
	
	auto l = groupS.length;
	writeln( ((l-1-2*K)/2 + 1).iota.map!( x => reduce!"a + b[1]"(0, groupS[2*x .. 2*x + 2*K+1]) ).reduce!"max(a,b)" );
}

