#include <iostream>
using namespace std;
int func(int ab){
  if(ab<10)ab=1;
  else{
    int tmp=1;
    while(ab>=10){
      ab=ab/10;
      tmp+=1;
    }
    ab=tmp;
  }
  cout<<ab<<endl;
  int a,b;
  a=-12;
  b=-13;
  cin>>a>>b;
  if(a!=-12&&b!=-13)func(a+b);
}
int main(){
  int a,b;
  cin>>a>>b;
  func(a+b);
}