#include<iostream>
using namespace std;

int a;
int b;

int main(){
	for (int i = 0; i < 200; i++){
		cin >> a >> b;
		if (a + b >= 1000000){
			cout << "7" << endl;
		}
		if (a + b >= 100000&&a+b<1000000){
			cout << "6" << endl;
		}
		if (a + b >= 10000&&a+b<100000){
			cout << "5" << endl;
		}
		if (a + b >= 1000&&a+b<10000){
			cout << "4" << endl;
		}
		if (a + b >= 100&&a+b<1000){
			cout << "3" << endl;
		}
		if (a + b >= 10&&a+b<100){
			cout << "2" << endl;
		}
		if (a + b >= 0 && a + b<10){
			cout << "1" << endl;
		}


}
	return 0;
}