semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	int x[1001], y[1001],i = 1, j, k, t = 0, p = 1, l, a[10000], m;
	char c;
	for (i = 1; ; i++)
	{
		cin >> x[i];
		cin.get(c);
		if (c == '\n')
			break;
	}
	for (i = 1; ; i++)
	{
		cin >> y[i];
		cin.get(c);
		if (c == '\n')
			break;
	}
	cout << i << " ";
	for (j = 1; j <= i; j++)
	{
		for (k = x[j]; k < y[j]; k++)
		{
			for (l = 1; l <= i; l++)
			{
				if (x[l] <= k && y[l] > k)
					t++;
			}
			a[p] = t;
			p++;
			t = 0;
		}
	}
	p--;
	m = a[1];
	for (j = 2; j <= p; j++)
	{
		if (m < a[j])
		{
			m = a[j];
		}
	}
	cout << m;
	return 0;
}
int Convert(int *n,char *s);

int main()
{
 int x[2000]={0},y[2000]={0};
 char s1[4000],s2[4000];
 int t,i,num,count=0,max=0;
 
 gets(s1);
 gets(s2);
 
 num=Convert(x,s1);
 Convert(y,s2);
 printf("%d",num);

 for(t=0;t<1000;t++)
    {
      for(i=0,count=0;i<num;i++)
         {
           if(t>=x[i]&&t<y[i])
             count++;
         }
      if(count>max)
         max=count;
    }

 printf(" %d",max);
 return 1;
}

int Convert(int *n,char *s)
{
 int lenth,i,j;
 lenth=strlen(s);
 for(i=0,j=0;i<lenth;i++)
    {
     if(s[i]!=',')
        n[j]+=n[j]*10+s[i]-'0';
     else 
          j++;
    }
 return j+1;
}
int main()
{
 int a[1000],i,j,b[1000],n,min=2000,max=0,ren=0,r;
 char c;
 for(i=0;;)
  {
   scanf("%d%c",&a[i],&c);
   if(c==',') {n=i;i++;}
    else break;
  }
 n=n+2;
 for(i=0;;)
  {
   scanf("%d%c",&b[i],&c);
   if(c==',') i++;
    else break;
  }
 for(i=0;i<n;i++)
  {
  if(a[i]<min) min=a[i];
  if(b[i]>max) max=b[i];
  }
 for(i=min;i<=max;i++)
  {
  r=0;
  for(j=0;j<n;j++)
   if(a[j]<=i && b[j]>i) r++;
  if(r>ren) ren=r;
  }
 printf("%d %d",n,ren);
 return 0;
}
//********************************
//*????????      **
//*?????? 1300012757 **
//*???2013.10.30  **
//********************************
int main()
{
	int a[1000], b[1000];
	int start, end, i = 0;
	do
	{
		cin >> start;
		a[i] = start;
		i ++;
	}while (cin.get() == ',');
	i = 0;
	do
	{
		cin >> end;
		b[i] = end;
		i ++;
	}while (cin.get() == ',');
	int t0 = 0,t = 0;
	for (int j =0;j < 1000 ; j++)
	{
		for (int p =0; p < i; p ++)
		{
			if (a[p] <= j && b[p] > j)
				t ++;
		}
		if (t > t0 ) t0 = t;
		t = 0;
	}
	cout << i <<" " << t0;
	return 0;

}
// 3.cpp : ??????????????
//

char x[5000],y[5000];     //x?y????????

int vis[1010]={0};     //????
int xx[1001]={0};        //????????????
int yy[1001]={0};
int main()
{
    //freopen("1.in","r",stdin);
    //freopen("1.out","w",stdout);
    cin.getline(x,5000);
    cin.getline(y,5000);
    int lenx=strlen(x),leny=strlen(y);
    int ans1=1;  //   ??
    for(int i=0;i<lenx;i++)
      if(x[i]==',') ans1++;
    cout<<ans1<<" ";
    int k=0;int t=1;
    
    for(int i=lenx-1;i>=0;i--)
     {  
         if(x[i]!=',') 
        {
            xx[k]+=(x[i]-'0')*t;         
            t=t*10;
        }
        else 
        {
             t=1;
             k++;
        }
     }
     k=0;t=1;
     for(int i=leny-1;i>=0;i--)
     {  
         if(y[i]!=',') 
        {
            yy[k]+=(y[i]-'0')*t;         
            t=t*10;
        }
        else 
        {
             t=1;
             k++;
        }
     }    
    for(int i=0;i<k+1;i++)
      for(int j=xx[i];j<yy[i];j++)
        vis[j]++;
    int max=vis[0];
    for(int j=0;j<1010;j++)
      if(vis[j]>max) max=vis[j];
    cout<<max<<endl;
    return 0;
}
void main()
{
	int data[3][1100],n,i,j,max;
	for(n=1;;)
	{
		char c;
		scanf("%d%c",&data[1][n],&c);
		if(c=='\n')
			break;
		n++;
	}
	for(n=1;;)
	{
		char c;
		scanf("%d%c",&data[2][n],&c);
		if(c=='\n')
			break;
		n++;
	}
	printf("%d",n);
	for(j=1,max=0;j<=n;j++)
		if(data[1][j]<=0&&data[2][j]>0)
			max++;
	for(i=1;i<=1000;i++)
	{
		int temp;
		for(j=1,temp=0;j<=n;j++)
			if(data[1][j]<=i&&data[2][j]>i)
				temp++;
		if(max<=temp)
			max=temp;
	}
	printf(" %d",max);
}
//********************************
//*??? ?????     **
//*?????? 1300012887 **
//*???2013.10.31 **
//********************************
int main()
{
	char ch, dh;
	int i, j, l, k, m, t = 0, x[1002], y[1002], z[1002];
	for (k = 0; k <= 1001; k++)    //????z?????????????????????
		z[k] = 0;
	for (i = 0; i < 1001; i++)    //??????????
	{
		cin >> x[i];
		ch = cin.get();
		if(ch != ',')
			break;
	}
	for (j = 0; j <= 1001; j++)    //??????????
	{
		cin >> y[j];
		dh = cin.get();
		if(dh != ',')
			break;
	}
	for (l = 0; l <= i; l++)    //??????????????????????????
	  for (k = x[l]; k < y[l]; k++)    //???????????
	      z[k] = z[k] + 1; 
	for (m = 0; m <= 1001; m++)    //???????????
	{
		if (t <= z[m])
			t = z[m];
	}
	cout << i+1 << " " << t << endl;
	return 0;
}
int main()
{
	int a[1000],b[1000],cnt=0,i=1,j,max=0;
	int c[1000];
	char dou;
	while(1)
	{
		cin>>a[i];
		i++;
		cnt++;
	if(	cin.get()!=',')break;

	
	}

    for(i=0;i<=999;i++)
	{
		c[i]=0;
	}
	
	for(i=1;i<=cnt-1;i++)
	{cin>>b[i];
	cin>>dou;}
	cin>>b[cnt];
	for(i=1;i<=cnt;i++)
	{
		for(j=a[i];j<b[i];j++)
		{
			c[j]++;
		}
	}
   	for(i=0;i<=999;i++)
	{
		if(c[i]>max)max=c[i];
	}
	cout<<cnt<<" "<<max<<endl;
	return 0;
}
int fa=0,fb=0;
int getnuma(char data[],int start)
{int i,j,k,l,n,m,tp=0;
 tp=data[start]-'0';start++;
 if ((data[start]==',')||(data[start]==0)) {fa=start+1;return tp;}
 else {tp=tp*10+data[start]-'0';start++;
		if ((data[start]==',')||(data[start]==0)) {fa=start+1;return tp;}
		else{tp=tp*10+data[start]-'0';start++;
				if ((data[start]==',')||(data[start]==0)) {fa=start+1;return tp;}
			}
		}
	 
}
int getnumb(char data[],int start)
{int i,j,k,l,n,m,tp=0;
 tp=data[start]-'0';start++;
 if ((data[start]==',')||(data[start]==0)) {fb=start+1;return tp;}
 else {tp=tp*10+data[start]-'0';start++;
		if ((data[start]==',')||(data[start]==0)) {fb=start+1;return tp;}
		else{tp=tp*10+data[start]-'0';start++;
				if ((data[start]==',')||(data[start]==0)) {fb=start+1;return tp;}
			}
		}
	 
}
int main()
{int i,j,k,l,n,m,people=1;
 char in[9000]={' '},out[9000]={' '};
 int time[2800]={0},max=0;
 scanf("%s%s",in,out);
 l=strlen(in);
 for (i=0;i<l;i++) if (in[i]==',') people++; 
 for (i=0;i<people;i++)
 {m=getnuma(in,fa);n=getnumb(out,fb);
  for (j=m;j<n;j++)
	  time[j]++;
 }
 for (i=1;i<1800;i++)
	 if (time[i]>max) max=time[i];
 printf("%d %d",people,max);
 return 7;
}
//?????
//2010?11?24?
//1000012753 ???
int main()
{
	int i, j = 0, k, x[2000], y[2000], count[2000] = {0}, max;
	char temp[2000];
	for (i = 0; ; i++)
	{
		cin >> x[i];
		temp[i] = cin.get();
		j++;
		if (temp[i] == '\n')
			break;
	}
	for (i = 0; i < j ; i++)
	{
		cin >> y[i];
		temp[i] = cin.get();
		if (temp[i] == '\n')
			break;
	}
	max = 0;
	for (i = 0; i <= 1000; i++)
	{
		for (k = 0; k < j; k++)
		{
			if (x[k] <= i && y[k] > i)
				count[i]++;
		}
		if (count[i] > max)
			max = count[i];
	}
	cout << j << " " << max << endl;
	return 0;
}
int n=0;
int people(int x[1000],int y[1000])
{
	int i,j,count[1000]={0},max=0;
	for(i=0;i<1000;i++)
	{
		for(j=0;j<n;j++)
		{
			if(i>=x[j]&&i<y[j])
				count[i]++;
		}
		
		if(count[i]>max)
			max=count[i];
	}
	return max;
}




int main()
{
	int i=1,x[1000]={0},y[1000]={0};
	cin>>x[0];
	n=1;
	while(cin.get()!='\n')
	{ 
		scanf("%d",&x[n]);
		n++;
	}
	cin>>y[0];
	while(cin.get()!='\n')
	{
		scanf("%d",&y[i]);
		i++;
	}
	cout<<n<<' '<<people(x,y);
	return 0;
}
int main()
{
    char a[10000],b[10000];
    memset(a,0,sizeof a);
    memset(b,0,sizeof b);
    cin.getline(a,10000);
    cin.getline(b,10000);
    double aa[10000],bb[10000];
    memset(aa,0,sizeof aa);
    memset(bb,0,sizeof bb);
    int sum1=1,sum2=1,i,j;
    double min=0,max=0;
    aa[1]=atof(a);
    bb[1]=atof(b);
    for(i=1;;i++)
    {
        if(a[i]!=','&&a[i]!=0&&a[i-1]==',')
        {
            sum1++;
            aa[sum1]=atof(&a[i]);
            if(aa[sum1]>max) max=aa[sum1];
            if(aa[sum1]<min) min=aa[sum1];
        }
        if(a[i]==0) break;
    }

    for(i=1;;i++)
    {
        if(b[i]!=','&&b[i]!=0&&b[i-1]==',')
        {
            sum2++;
            bb[sum2]=atof(&b[i]);
            if(bb[sum2]>max) max=bb[sum2];
            if(bb[sum2]<min) min=bb[sum2];
        }
        if(b[i]==0) break;
    }

    cout<<sum1<<" ";
    int people[10000];
    memset(people,0,sizeof people);
    min=(int) min;
    max=(int) max;

    for(i=min;i<=max;i++)
    {
        for(j=1;j<=sum1;j++)
        {
            if(i>=aa[j]&&i<bb[j]) people[i]++;

        }
    }
    int Max=0;
    for(i=min;i<=max;i++)
    {
        if(people[i]>Max) Max=people[i];


    }
    cout<<Max;






    return 0;
}
int main()
{
    int x[10000],i=0,y[10000],m,n,w[10000],t,j;
    char c,z[13];
    x[0]=-1;y[0]=-1;
    do{
        i++;
        scanf("%d",&x[i]);if(x[i]<x[i-1]){t=x[i];x[i]=x[i-1];x[i-1]=t;}
        c=getchar();
        }while(c==',');
    m=i;
    for(i=m-1;i>=1;i--)
    {if(x[i]>x[i+1]){t=x[i];x[i]=x[i+1];x[i+1]=t;}}
 //   for(i=1;i<=4;i++)printf("%d",x[i]);
    
    i=0;  
    do{
        i++;
        scanf("%d",&y[i]);if(y[i]<y[i-1]){t=y[i];y[i]=y[i-1];y[i-1]=t;}
        c=getchar();
        }while(c==',');//for(i=1;i<=4;i++)printf("%d",y[i]);
    n=i;w[x[1]]=0;
    for(i=x[1];i<=y[n];i++)
    {w[i+1]=w[i];
                           for(j=1;j<=n;j++){if(i==x[j])w[i+1]++;if(i==y[j])w[i+1]--;}
                          // printf("%d\n",w[i+1]);
                           }
    for(i=x[1];i<=y[n];i++)
    {
                           if(w[i+1]<w[i]){t=w[i+1];w[i+1]=w[i];w[i]=t;}
                           }
    printf("%d %d",n,w[y[n]+1]);
    
    
    
    
  //  scanf("%s",z);

    //scanf("%s %d",a,&k);
    }
int main()
{
	int a[1000],b[1000],s,i,c[1000],max;
	memset(c,0,sizeof(c));
	cin>>a[0];
	char d;
	for(i=1;i<1000;i++)
		{
		if(cin.peek()==',')
		   {
			cin>>d;
			cin>>a[i];
		   }
		else
			break;
		}
	s=i-1;
	cin>>b[0];
	for(i=1;i<1000;i++)
			{
			if(cin.peek()==',')
			   {
				cin>>d;
				cin>>b[i];
			   }
			else
				break;
			}
	for(i=0;i<=s;i++)
		for(int j=a[i];j<b[i];j++)
			c[j]++;
	max=c[0];
	for(i=1;i<1000;i++)
		if(c[i]>max)
			max=c[i];
	cout<<s+1<<" "<<max;
	return 0;
}
/*
 *@file 5.cpp
 *@author ???
 *@date 11?1?
 *@description ?????
 */

int main ()
{
	int x[1000], y[1000], t[1000] ={0}, max;
	int i, j, k;
	max = 0;
	char ch;
	for (i = 0; ; i++)
	{
		cin >> x[i];
		ch = cin.get();
		if (ch != ',')
			break;
	}
	for (i = 0; ; i++)
	{
		cin >> y[i];
		ch = cin.get();
		if (ch != ',')
			break;
	}
	for (j = 0; j <= i; j++)
	{
		for (k = x[j]; k < y[j]; k++)
		{
			t[k] = t[k] + 1;
			if (t[k] > max) 
				max = t[k];
		}
	}
		
	cout << i + 1 << " " << max;
	return 0;
}
int main()
{
	int arr[1001];
	int left[1001];
	int cnt;
	int i,j,k;
	while(scanf("%d",&arr[0])!=EOF)
	{
		cnt=1;
		char ch;
		while(scanf("%c",&ch)!=EOF&&ch==',')
		{
			scanf("%d",&arr[cnt]);
			cnt++;
		}
		for(i=0;i<cnt-1;i++)
			scanf("%d,",&left[i]);
		scanf("%d",&left[cnt-1]);
		int min=arr[0];
		int max=left[0];
		for(i=0;i<cnt;i++)
		{
			if(arr[i]<min)
				min=arr[i];
			if(left[i]>max)
				max=left[i];
		}
		int count=0;
		int mcnt=0;
		for(i=min;i<=max;i++)
		{
			count=0;
			for(j=0;j<cnt;j++)
			{
				if(arr[j]<=i&&left[j]>i)
					count++;
			}
			if(count>mcnt)
				mcnt=count;
		}
		printf("%d %d\n",cnt,mcnt);
	}
}
int main(){
int a[1000],b[1000];
char c;
int i=0;
int max=0;

while(true){
	cin>>a[i];
	if((c=cin.get())=='\n')
		break;
	else i++;
}

int sum=i+1;
i=0;
while(true){
	cin>>b[i];
	if((c=cin.get())=='\n')
		break;
	else i++;
}



for(i=0;i<sum;i++)
	if(max<b[i])
		max=b[i];



int time[max];

for(i=0;i<max;i++)
	time[i]=0;

for(i=0;i<sum;i++)
	for(int j=a[i];j<b[i];j++)
		time[j]++;
int num=0;

for(i=0;i<max;i++)
	if(num<time[i])
		num=time[i];

cout<<sum<<' '<<num<<endl;

return 0;
}
int fan(int);
void main()
{
	int a[10000],b[10000],c[10000]={0},n,m=0,i=0,j;
	do
	{
		scanf("%d",&a[i++]);
	}while(getchar()!='\n');
	i=0;
	do
	{
		scanf("%d",&b[i++]);
	}while(getchar()!='\n');
	printf("%d ",i);
	for(j=0;j<i;j++)
		if(m<b[j])
			m=b[j];//m-1?????????
	for(j=0;j<m;j++)//???????
	{
		for(n=0;n<i;n++)//??????
			if(j>=a[n]&&j<b[n])
				c[j]++;
	}
	for(i=1,n=c[0];i<m;i++)
		if(n<c[i])
			n=c[i];
	printf("%d",n);
}
int main(){
	int a[1001],n,i,j,k,vis[1001];
	char c;
	n = 1;
	scanf("%d",&a[n]);
	while (scanf("%c",&c),c ==','){
		n ++;
		scanf("%d",&a[n]);
	}
	for (i = 0;i <= 1000;i++) vis[i] =0;
	for (i = 1;i <= n;i++){
		scanf("%d",&k);scanf("%c",&c);
		for (j = a[i];j <k;j++) vis[j]++;
		}
	k = 0;
	for(i = 0;i<= 1000;i++)
		 if (vis[k] < vis[i]) k = i;
	cout<<n<<' '<<vis[k]<<endl;
	return 0;
}
//*********************** 
//?????????? 
//?????? 1300012849 
//???2013?11?1? 
//*********************** 
int main ()
{
    int sum = 0;                              //????????sum 
    char c;                                   //??cin.get()??????c 
    int i = 0 , j , p;
    int a[1000];                              //???????????????????????????? 
    while ( cin >> a[i])                      //???????????+1?????????? 
    {
          sum++;
          c = cin.get();
          if ( c == ',')                      //????????????????????????? 
               i++;
          else                                //????????????????????sum???????? 
               break;
    }
   
    int b[sum];                               //????sum??????b??????????????? 
    for ( i = 0; i <= sum - 1; i++ )          //??????????????b????? 
    {
        cin >> b[i];
        cin.get();
    }
   //????i????????????????????a[i-1],b[i-1]
    
   int d[1000];                               //??????d?????????????????d[0]??0?????????d[15]??15???????? 
   for ( i = 0; i <= 999; i++ )               //??????????????0 
         d[i] = 0;
   
   //?????a[i]?????b[i]????????J??? J >= a[i] ? J < b[i]??????????d[j]++???j?????????+1 
   for ( i = 0; i <= sum - 1; i++ )           
   {                                          
       for ( j = 0; j <= 999; j++ )
       {
           if ( j >= a[i] && j < b[i] )
                d[j]++;
       }
   }
   
   for ( i = 1; i <= 999; i++ )               //??????d??????????????????????d[999]????????????? 
   {
       for ( j = 0; j <= 999 - i; j++ )
       {
           if ( d[j] > d[j+1])
           {
                p = d[j+1];
                d[j+1] = d[j];
                d[j] = p;
           }
       }
   }
   
   cout << sum << " "<< d[999] << endl;
}
int max(int x,int y)
{
    return(x>y?x:y);
}

int main()
{   //int a[1000];
    int x[1000];
    int y[1000];
    int z[1000]={0,0};
    int t;
    int m=0;
    char c;
    int i=1,num=0;
    //if(getchar()=='\n')
    //{

    // if(getchar()=='\n')
      //  cout<<0<<" "<<0;
  //  }
    //else
  //  {
        cin>>x[0];
    while(getchar()!='\n')
  {

      cin>>x[i];


      i=i+1;
      num=num+1;

  }
//cout<<num;

    for(i=0;i<num;i++)
    {
        cin>>y[i];
        cin>>c;

    }
    cin>>y[num];
  for(i=0;i<=num;i++)
  {
      for(t=0;t<10000;t++)
      {
          if(t>=x[i]&&t<y[i])
            z[t]=z[t]+1;
      }
  }
  for(i=0;i<1000;i++)
  {
      m=max(z[i],m);
  }
  cout<<num+1<<" "<<m;

   // }


    return 0;
}
main()
{
	int m,n,i,j,k,l1,l2,t,t1[1000],t2[1000];
	int c[1000][1000],x[1000];
	
	char a1[10000],a2[10000];
	gets(a1);
	

	l1=strlen(a1);

	n=0;t=-1;
	for(i=0;i<=l1;i++)
	{ if(a1[i]==','||a1[i]=='\0'){
		n++;
		if(i-t==2) t1[n]=a1[i-1]-'0';
		else if(i-t==3) t1[n]=a1[i-1]-'0'+(a1[i-2]-'0')*10;
		else if(i-t==4) t1[n]=a1[i-1]-'0'+(a1[i-2]-'0')*10+(a1[i-3]-'0')*100;t=i;}
	}

    n=0;t=-1;gets(a2);l2=strlen(a2);
	for(i=0;i<=l2;i++)
	{ if(a2[i]==','||a2[i]=='\0'){n++;
		if(i-t==2) t2[n]=a2[i-1]-'0';
		else if(i-t==3) t2[n]=a2[i-1]-'0'+(a2[i-2]-'0')*10;
		else if(i-t==4) t2[n]=a2[i-1]-'0'+(a2[i-2]-'0')*10+(a2[i-3]-'0')*100;t=i;}
	}

	for(i=0;i<1000;i++) {for(j=0;j<1000;j++) c[i][j]=0;}

	for(i=1;i<=n;i++)  
	{
		for(j=t1[i];j<t2[i];j++) { c[i][j]=1;}
	}

	for(i=1;i<1000;i++) x[i]=0;
	for(i=1;i<1000;i++)
	{ for(j=1;j<=n;j++) {if(c[j][i]==1) x[i]++;}
	}

	m=0;
	for(i=1;i<1000;i++)
		if(x[i]>m) m=x[i];


		printf("%d %d",n,m);
}
int main()
{
	char temp = 0;
	int time[1000] = {0}, t[2][1000] = {0}, num = 0,i = 0, j = 0, max = 0;
	for (i = 0; i < 2; i++, temp = 0)
		for (j = 0; temp != '\n'; j++)
		{
			cin >> t[i][j];
			temp = cin.get();
		}
	num = j;
	for (i = 0; i < num; i++)
		for (j = t[0][i]; j < t[1][i]; j++)
			time[j]++;
	for (i = 0; i < 1000; i++)
		if (time[i] > max)
			max = time[i];
	cout << num << " "<< max;
	return 0;
}
int main()
{
	char time1[10000],time2[10000];
	int timein[1000],timeout[1000],sta[1000];
	int i,j=0,k,flag=0,max=0,people=0;
	cin.getline(time1,10000);//???????????
	cin.getline(time2,10000);//???????????
	for(i=0;i<10000;i++)//????
	{
		if(time1[i]==',')
			people++;
		else if(time1[i]=='\0')
			break;
	}
	if(people!=0)
		people++;
	for(i=0;i<1000;i++)//???
	{
		timein[i]=-1;
		timeout[i]=-1;
		sta[i]=0;
	}
	for(i=0;i<10000;i++)//?????????????????
	{
		if(time1[i]==',')
		{
			timein[j]=0;
			for(k=i-1;k>=flag;k--)
			{
				
				timein[j]=timein[j]+(time1[k]-'0')*(int)pow(10.0,(double)(i-1-k));
			}
			flag=i+1;
			j++;
		}
		else if(time1[i]=='\0')
		{
			timein[j]=0;
			for(k=i-1;k>=flag;k--)
			{
				
				timein[j]=timein[j]+(time1[k]-'0')*(int)pow(10.0,(double)(i-1-k));
			}
			break;
		}
	}
	flag=0;j=0;
	
	for(i=0;i<10000;i++)//?????????????????
	{
		if(time2[i]==',')
		{
			timeout[j]=0;
			for(k=i-1;k>=flag;k--)
			{
				
				timeout[j]=timeout[j]+(time2[k]-'0')*(int)pow(10.0,(double)(i-1-k));
			}
			flag=i+1;
			j++;
		}
		else if(time2[i]=='\0')
		{
			timeout[j]=0;
			for(k=i-1;k>=flag;k--)
			{
				
				timeout[j]=timeout[j]+(time2[k]-'0')*(int)pow(10.0,(double)(i-1-k));
			}
			break;
		}
	}

	for(i=0;i<1000;i++)//??????????
	{
		if(timein[i]!=-1)
		{
			for(k=timein[i];k<timeout[i];k++)
				sta[k]++;
		}
		else break;
	}
	for(i=0;i<1000;i++)//???????????
	{
		if(sta[i]>max)
			max=sta[i];
	}
	cout<<people<<" "<<max<<endl;//??
	return 0;
}
//********************************
//*????????   **
//*????? 1300012845 **
//*???2013.10.30  **
//********************************
int main()//???
{
	int x[1000]={0};
	int y[1000]={0};
	int num=0,i,t,tmax=0,Nmax=0;
	int N[1000]={0};
	char p=0;
	do
	{
		cin >> x[num];
		num++;
		p=cin.get();
	}
	while (p!='\n');
	num=0;
	do
	{
		cin >> y[num];
		num++;
		p=cin.get();
	}
	while (p!='\n');
	for (i=0; i<=num; i++)
	{
		if ( y[i] > tmax )
			tmax = y[i];
	}
	for (t=0; t<=tmax; t++)
	{
		for (i=0; i<=num; i++)
		{
			if ( t< y[i] && t>= x[i] )
				N[t]++;
		}
	}
	for ( t=0; t<=tmax; t++ )
	{
		if (N[t] > Nmax )
			Nmax = N[t];
	}
	cout << num << " " << Nmax << endl;
	return 0;
}
void paixu(int n,int y[])
{
	int i,j,t,k;
	for(i=0;i<n;i++)
	{
		t=y[i];
		k=i;
		for (j=i+1;j<n;j++)
		{
			if(y[j]<t)
			{
				t=y[j];k=j;
			}
		}
		y[k]=y[i];y[i]=t;
	}
}
main()
{
	int i=1,j,k,l,max=0,x[1001],y[1001];
	char b;
	scanf("%d",&x[0]);
	while(scanf("%c",&b),b==',')
	{
		scanf("%d",&x[i]);
		i++;
	}
	i=1;
	scanf("%d",&y[0]);
	while(scanf("%c",&b),b==',')
	{
		scanf("%d",&y[i]);
		i++;
	}
	printf("%d ",i);
	for (j=0;j<=1000;j++)
	{
		l=0;
		for (k=0;k<i;k++)
		{
			if (j>=x[k]&&j<y[k]) l++;
		}
		if (l>max) max=l;
	}
	printf("%d",max);
}
int convert(char s[],int result[])
{
	int value,len,num=0,k=0;
	len=strlen(s);
	s[len]='\0';
	while(k<len)
	{
		value=0;
		while((s[k]!=',')&&(s[k]!='\0'))
			value=value*10+s[k++]-'0';
		result[num++]=value;
		k=k+1;
	}
	return(num);
}
void f(int x[],int y[],int num[],int total)
{
	int i,j;
	for(i=0;i<total;i++)
	{
		for(j=x[i];j<y[i];j++)
		{
			num[j]=num[j]+1;
		}
	}
}
void main()
{
	int num[1000]={0};
	int x[1000],y[1000];
	char s1[10000],s2[10000];
	gets(s1);
	gets(s2);
	int total;
	total=convert(s1,x);
	total=convert(s2,y);
	f(x,y,num,total);
	int max=num[0],i;
	for(i=0;i<1000;i++)
	{
		if(num[i]>max)
			max=num[i];
	}
	printf("%d %d",total,max);
}
void main()
{
	int x[1000];
	int y[1000];
	char a,b;
	int i,j,k=0,r=0,n=0;
	for(i=0;;i++)
	{
		scanf("%d%c",&x[i],&a);
		n=n+1;
		if(a!=',')break;
	}
	for(i=0;;i++)
	{
		scanf("%d%c",&y[i],&b);
		if(b!=',')break;
	}
	for(j=0;j<1000;j++)
	{
		for(i=0;i<n;i++)
		{
			if(j>=x[i]&&j<y[i])k=k+1;
		}
		if(k>r)
		{
			r=k;
		}
		k=0;
	}
	printf("%d %d",n,r);


}
int main()
{
	int i,num1[1000],num2[1000],len,count1=0,min=0,max=2000,maxnum=0,j;
	char ch;
	for(i=0;;i++)
	{
		cin>>num1[i];
		if(num1[i]<min)
			min=num1[i];
		ch=getchar();
		if(ch=='\n')
		{
			len=i+1;		
			break;
		}
	}
	for(i=0;i<len;i++)
	{
		cin>>num2[i];
		if(num2[i]>max)
			max=num2[i];
		ch=getchar();	
	}
	for(i=min;i<=max;i++)
	{
		count1=0;
		for(j=0;j<len;j++)
		{
			if(i>=num1[j]&&i<num2[j])
				count1++;
		}
		if(count1>maxnum)
			maxnum=count1;
	}
	cout<<len<<" "<<maxnum<<endl;
	return 0;
}
//  **********************************
//  ****  ?????.cpp  ****
//  ****  Author ???           ****
//  ****  ID  1000012895          ****
//  ****  Date 2010 / 11 / 24     ****
//  **********************************
int main()
{
	int i, j, cou, sum = 1, max = 0, sub;
	int num[1000];
	char stra[99999], strb[99999];
	int a[5000], b[5000];
	cin.getline(stra, 99999);
	cin.getline(strb, 99999);
	for(cou = 0; strb[cou] != '\0'; cou++)
		if(strb[cou] == ',')
			sum++;
	i = 0; j = 0;
	for(sub = 0; sub <= cou; sub++)
	{
		if(stra[sub] == ',' || stra[sub] == '\0')
		{
			a[i] = (stra[sub - 1] - '0') * 1;
			if(stra[sub-2] != ',' && sub - 2 >= 0)
			{
				a[i] += (stra[sub - 2] - '0') * 10;
				if(stra[sub-3] != ',' && sub - 3 >= 0)
				{
					a[i] += (stra[sub - 3] - '0') * 100;
					if(stra[sub-4] != ',' && sub - 4 >= 0)
						a[i] += (stra[sub - 4] - '0') * 1000;
			}}
			i++;
		}
		if(strb[sub] == ',' || strb[sub] == '\0')
		{
			b[j] = (strb[sub - 1] - '0') * 1;
			if(strb[sub-2] != ',' && sub - 2 >= 0)
			{
				b[j] += (strb[sub - 2] - '0') * 10;
				if(strb[sub-3] != ',' && sub - 3 >= 0)
				{
					b[j] += (strb[sub - 3] - '0') * 100;
					if(strb[sub-4] != ',' && sub - 4 >= 0)
						b[j] += (strb[sub - 4] - '0') * 1000;
			}}
			j++;			
		}
	}
	for(j = 0; j < 1000; j++)
	{
		num[j] = 0;
		for(i = 0; i < sum; i++)
			if(a[i] <= j && b[i] > j)
				num[j]++;
		if(num[j] > max)
			max = num[j];
	}
	cout << sum << ' ' << max << endl;
	return 0;
}
//***********************************
//*???Oct 30, 2013 - ????? **
//*?????? 1300012719         **
//*???2013.10.31                **
//***********************************
int main()
{
	int n = 0, i, j, a = INT_MAX, b = INT_MIN, x[1000], y[1000], number[1000];
	char c;                                  //n?????????,i,j?????,a,b?????????,x[i],y[i]?????????,number[i]???????
	while (c != '\n')                        //????(??,??),?????????
	{
		cin >> x[n];                         //??x[n],???x[n]???a,?????n???????
		if (a > x[n])                        //?????x[1000]???x[0]?x[n-1]?n???
			a = x[n];
		n++;
		c = cin.get();
	}
	for (i = 0; i < n; i++)                  //????(??,??)n?y[i],???????b
	{
		cin >> y[i];
		if (b < y[i])
			b = y[i];
		c = cin.get();
	}
	for (i = a; i < b; i++)                  //?????????[a,b)??????????
	{
		number[i] = 0;                       //?????
		for (j = 0; j < n; j++)
		{
			if ((x[j] <= i) && (y[j] > i))   //?n????,??????????????,????????+1
				number[i]++;
		}
	}
	for (i = a + 1; i < b; i++)              //???????number[a]?number[b-1]???
	{                                        //??number[a]??????,?number[a]??????????number[a]
		if (number[a] < number[i])           //???number[a]????number[a]?number[b-1]?????
			number[a] = number[i];
	}
	cout << n << " " << number[a] << endl;   //???????????????
	return 0;
}
int main()
{
	int a[10000], b[10000];
	int i = 0, j = 1;
	int q;
	char p;
	while(cin >> q)
	{
		a[i++] = q;
		cin >> p;
		if(p != ',')
			break;
	}
	char s[4];
	s[0] = p;
	while(cin >> s[j++])
		if(s[j - 1] == ',')
			break;
	b[0] = atoi(s);
	for(j = 1; j < i - 1; j++)
		cin >> b[j] >> p;
	cin >> b[j];
	q = i;
	cout << q << ' ';
	int sum, max = 0;
	for(i = 0; i < 1000; i++)
	{
		sum = 0;
		for(j = 0; j < q; j++)
			if(i >= a[j] && i < b[j])
				sum++;
		if(sum > max) max = sum;
	}
	cout << max;
	return 0;
}
int main()
{int x[1000],y[1000],people[1001]={0};
 int i=0,length=0;
 do
   cin>>x[i++];
 while(cin.get()==',');
 length=i;i=0;
 do
   cin>>y[i++];
 while(cin.get()==',');
 for(i=0;i<length;i++)
  for(int j=x[i];j<y[i];j++)
     people[j]++;
 int max=0;
 for(i=0;i<=1000;i++)
  if(people[i]>max)
    max=people[i];
 cout<<length<<' '<<max;
 return 0;
}