#include<iostream>
#include<string>
using namespace std;
int main(){
	int a,b;
	while(true){
	cin>>a>>b;
	if(a==-1||b==-1)
		break;
	int i=0;
	int h=a+b;
	while(true){
		if(0==h)
			break;
		i++;
		h/=10;
	}
	cout<<i<<endl;
	}
	return 0;
}