import std.stdio;
import std.string;
import std.conv;

immutable MIN = 0;
immutable MAX = 1000000;
immutable DATA_SET = 200;

int main(string[] argv)
{
	string[] ans;
	
	int data = 0;
	while(data < DATA_SET){
		string tmp1 = readln().chomp();
		int t1 = tmp1.chomp().split(" ")[0].to!int();
		int t2 = tmp1.chomp().split(" ")[1].to!int();
		if(judge(t1) && judge(t2)){
			ans ~= (t1 + t2).to!string();
			data++;		
		}
	}

	foreach(str;ans){
		writeln(str.length);
	}

    return 0;
}

bool judge(int x){
	if(MIN <= x && x <= MAX){
		return true;
	}
	return false;
}