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;
    var tmp = 0;
    for(var i=0;i<K;i++) tmp += list[i];
    ans = tmp;
    for(var i=K;i<N;i++){
        tmp -= list[i-1];
        tmp += list[i];
        ans = Math.max(ans,tmp);
    }
    
    console.log(ans);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split("\n"))
