#include<stdio.h>
int main()
{
    long int a,b,sum,temp,i=0,j=0;
    while (scanf("%ld%ld",&a,&b)==2)
    {
        while(a!=0)
        {
            temp=a%10;
            a=a/10;
            if(temp!=0)
            {
                i++;
            }
        }
        while(b!=0)
        {
            temp=b%10;
            b=b/10;
            if(temp!=0)
            {
                j++;
            }
        }
        sum=i+j;
        printf("%ld\n",sum);
    }
    return 0;
}