#include <iostream>
#include <string>
#include <sstream>

using namespace std;

 string IntToString(int num){
	stringstream ss;
	ss << num;
	return ss.str();
}


int main(void){
	int count = 0;
	int arr[200] = {0, };
	for (int i=0; i<200; i+=2){
		int a, b;
		cin >> a >> b;
		if (((a < 0) || (b < 0)) || ((1000000 < a) || (1000000 < b))){
			break;
		}
		arr[i] = a;
		arr[i+1] = b;

		++count;
	}
	for (int i=0; i<(2*count); i+=2){
		int sum = arr[i]+arr[i+1];
		string str = IntToString(sum);
		cout << str.length() << endl;
	}
	return 0;
}