#include <stdio.h>
int dig(int x){
  int pow = 0;
  while (x){
    x /= 10;
    pow++;
  }
  return pow;
}
int main(){
  int a,b,cnt = 0;
  while(1){
    scanf("%d",&a);
    if (a == -1)  break;
    scanf("%d", &b);
    printf("%d\n", dig(a + b));
  }
  return 0;
}
