#include<iostream>

using namespace std;


int main()
{
	int a, b,x;
	
	cin >> a >> b;
	int ar[7] = { 1, 2, 3, 4, 5, 6, 7 };
	while (a != -1){
		int counter = -1;
		x = a + b;
		while (x != 0){
			x /= 10;
			counter++;
		}
		cout << ar[counter] << endl;
		cin >> a >> b;
	}
	
}