#include<stdio.h>
int main()
{
    int a,b,count1=0,count2=0;
    while(scanf("%d %d",&a,&b)==2)
    {

    if(a<=9)
    count1=1;
    if(a>10 && a<=99)
    count1=2;
     if(a>100 && a<=999)
    count1=3;
     if(a>1000 && a<=9999)
    count1=4;
     if(a>10000 && a<=99999)
    count1=5;
    if(a>100000 && a<=999999)
    count1=6;
    if(a==10 ||a==100 ||a==1000 ||a==10000 ||a==100000 ||a==1000000 ||a==10000000)
    count1=1;
    if(b<=9)
    count2=1;
    if(b>10 && b<=99)
    count2=2;
     if(b>100 && b<=999)
    count2=3;
     if(b>1000 && b<=9999)
    count2=4;
     if(b>10000 && b<=99999)
    count2=5;
    if(b>100000 && b<=999999)
    count2=6;
    if(b==10 ||b==100 ||b==1000 ||b==10000 ||b==100000 ||b==1000000 ||b==10000000)
    count2=1;
printf("%d\n",count1+count2);
    }
    return 0;
}