var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var arr= input.trim().split("\n");
var str = arr[1];
var max=1;
str.replace(/ /g,"").replace(/1+/g,function(s){
   max=Math.max(s.length+1,max);
});
console.log(max);
