#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <set>
#include <map>
#include <vector>
#define CL(a) memset(a,0,sizeof(a))
#define cl(a,b) memset(a,(b),sizeof(a))
#define For(i,a,b) for(i=a;i<b;i++)
#define LL long long 
using namespace std;
const int maxn = 5e6 + 100;
char a[maxn];
int main()
{
	scanf("%s",a);
	int i,j;
	int len = strlen(a);
	//a[len++] = '1';
	//a[len] = '\0';
	int ans = 0;
	int x = 0;
	for(i=0;i<len;i++){
		if(a[i]=='1') ans = max(ans,x),x = 0;
		else x++;
	}
	if(x) ans = max(ans,x); 
	cout<<max(ans,2)<<endl;
	
	
	
	return 0;
}