#include<iostream>
#include<cmath>

using namespace std;

int main(void){

 int a,b;
 int ans;

 while(1){
  cin >> a >> b;

  if(a==0 %% b==0)
   break;

  ans=log10(a+b)+1;
  cout << ans << endl;
 }
}
