#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <sstream>
#include <fstream>

using namespace std;

int add (string a, string b)
{
	reverse (a.begin(), a.end() );
	reverse (b.begin(), b.end() );

	while (a.length() != b.length()){
		if (a.length() > b.length()){
			b += '0';
		}else if (a.length() < b.length() ){
			a += '0';
		} // end if
	} // end while

	int i;
	string res = "";
	int carry = 0;

	for (i = 0; i < a.length(); ++i){

		int an = a[i] - '0';
		int bn = b[i] - '0';
		int sum = an + bn + carry;

		res += sum % 10 + '0';
		carry = sum/10;

	} // end for

	if (carry == 1){
		res += carry + '0';
	} // end if

	return res.length();
}

int main()
{
	string str = "";
	string a,b;

	while (getline (cin, str )){

		stringstream ssn(str );
		ssn >> a >> b;

		int res = add (a, b );

		cout << res << endl;	

	} // end while
		
	return 0;
}