#include<iostream>

int main(){
int a, b, c = 0, d = 0;
std::cin >> a >> b;
for(){
        if(a < 10){
                a = a % 10;
                c++;
                }else
                break;
        }
for(){
        if(b < 10){
                b = b % 10;
                d++;
                }else
                break;
        }
std::cout << c + d;
}

 
                 