function main(input){
    var lines = input.split("\n");
    var N = lines[0];
    var K = lines[1];
    lines.splice(0,2);

    var kuu = N(N+1)/2;

    var max=0;
    var mem=0;
    for (var i=0;i<kuu ;i++ ) {
    	mem=0;
    	var l=0;
    	var k=1;
    	while(k<=kuu){
    		while(l<k){
    			mem+=lines[l];
    			l++;
    		}
    		if(mem>max){max=mem;}
    		k++;
    	}

    }
    console.log(max);
}

main(require('fs').readFileSync('/dev/stdin', 'UTF-8'));