#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <cctype>
#include <cstring>
#include <string>
#include <vector>


using namespace std;

int main()
{
    int i,j;
    int t;
    while(scanf("%d",&i) != EOF)
    {
        int sum=0;
        cin >> j;

        while(i!=0)
        {
            t=i%10;
            i= i/10;
            if(t!=0)
                sum++;
        }

        while(j!=0)
        {
            t=j%10;
            j= j/10;
            if(j!=0)
                sum++;
        }

        sum++;
        cout << sum <<endl;
    }
}