#include <iostream>
#include <cmath>
using namespace std;

int main(){
	int a,b;
	while(cin>>a>>b){
		
		if( a<0||b<0||1000000<a||1000000<b)
			break;
		cout<<(int(log10(a+b))+1)<<endl;
	}
	return 0;
}