#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;

int main(){
	int a, b, sum;

	while(1){
		cin >> a >> b;
		
		if(cin.fail()){
			break;
		}

		sum = a + b;

		if(sum >= 1000000){
			cout << 7 << endl;
		}
		else if(sum >= 100000){
			cout << 6 << endl;
		}
		else if(sum >= 10000){
			cout << 5 << endl;
		}
		else if(sum >= 1000){
			cout << 4 << endl;
		}
		else if(sum >= 100){
			cout << 3 << endl;
		}
		else if(sum >= 10){
			cout << 2 << endl;
		}
		else if(sum >= 1){
			cout << 1 << endl;
		}
		else{
			cout << 0 << endl;
		}
	}
	

	return 0;
}