#include <iostream>
#include <string>
using namespace std;
int main()
{
	int a, b;
	while (1){
		cin >> a;
		if (a < 0){
			break;
		}
		cin >> b;
		auto sum = a + b;
		string str(to_string(sum));
		cout << str.size();
	}

}