function main(input) {
    var N = input[0].split(" ")[0]-0;
    var K = input[0].split(" ")[1]-0;
    var list = input[1].split(" ").map(v=>((v-0)+1)/2);
    var ans = 0;
    for(var i=0;i<N-K;i++){
        var sum = 0;
        for(var j=i;j<i+K;j++){
            sum += list[j];
        }
        ans = Math.max(ans,sum);
    }
    
    console.log(ans);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split("\n"))
