main(){char c[15],t[8];scanf("%s\n%s",c,t);strcat(c,t);int s,i=0,a=0;while(c[i]>0){s=0;while(c[i]==111){s++;if(s>a)a=s;i++;}i++;}printf("%d",a);}