#include<iostream>
using namespace std;
void calculate(char *src,int *max0,int *max1)
{
int temp0=0,temp1=0;
while(*src)
{
if(*src=='0')
{
(*max0)++;
if(*(++src)=='1')
{
if(temp0<*max0)
{
temp0=*max0;
}
*max0=0;
}
}
else if(*src=='1')
{
(*max1)++;
if(*(++src)=='0')
{
if(temp1<*max1)
{
temp1=*max1;
}
*max1=0;
}
}
}
*max0=temp0;
*max1=temp1;
}
int main()
{
char *str="00001110110000001100110101101001010101011111010";
int max0=0,max1=1;
calculate(str,&max0,&max1);
cout<<max0<<" "<<max1<<endl;
return 0;
}