/*
TASK:hexa
LANG:C
*/

//#define DEBUG

#include <stdio.h>

#define IN      "hexa.in"
#define OUT     "hexa.out"
#define MAX     (1<<20)

char data[MAX], ch;
long pos[MAX], two, n;
long resin;

int main()
{
   long i, j, diff;

#ifdef DEBUG
   freopen(IN, "r", stdin);
   freopen(OUT, "w", stdout);
#endif

   ch=getc(stdin);
   while(ch=='1' || ch=='2')
   {
      data[n++]=ch-'0';
      ch=getc(stdin);

      if(data[n-1]==2)
        pos[two++]=n-1;
   }
   pos[two]=n+pos[0];

   for(i=0; i<two; i++)
   {
      diff=pos[i+1]-pos[i];
      
      switch(diff)
      {
         case 1: resin++;break;
         case 2: resin++;break;
         case 3: resin++;break;
         case 4: break;
      }
   }

   if(!two) resin=1;

   printf("%ld %ld\n", n-two, resin);

#ifdef DEBUG
   fclose(stdin);
   fclose(stdout);
#endif

   return 0;
}

