#include<iostream>
#include<string>
#include <algorithm>
#include<iomanip>
#include<cmath>
using std::cin; using std::string;
using std::cout; using std::endl;
using std::sort;
#define rep(X,Y) for(int (X)=0;(X)<(Y);++(X))
#define rept(X,Y,Z) for(int (X)=(Y);(X)<(Z);++(X))
#define repr(X,Y) for(int (X)=(Y);(X)>=0;--(X))
const double pi=3.141592653589793283462;
int main(){
	int m,n;
	int cm=1,cn=1;
	while(cin>>m>>n){
	for(int i=0;i<7;i++){
		    if(m/10>10){
				    m/=10;
					cm++;
			}
			if(n/10>10){
			     n/=10;
				 cn++;
			}
		}
	cout<<cm+cn<<endl;
	cm=1;
	cn=1;
	}
	return 0;
}      