#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b;
  int ans[201];
  int cnt=0;
  while(cin>>a>>b){
    int temp=a+b;
    int n=9;
    int count=1;
    while(1){
      if(n>=temp){
	break;
      }else{
	count++;
	n=n*10+9;
      }
    }
    ans[cnt]=count;
    cnt++;
  }
  for(int i=0;i<cnt;i++){
    cout<<ans[i]<<endl;
  }
  return 0;
}
	
      
      
  