#include <iostream>
#include <cmath>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
using namespace std;




int main()
{
	long long int a,b;
	char c1[15],c2[15];
	int count=0;
	int i;
	while(scanf("%lld %lld",&a,&b)==2)
	{
		itoa(a,c1,10);
		itoa(b,c2,10);
		i=0;
		while(i<strlen(c1))
		{
			if(c1[i]!='0')
			{
				count++;
			}
			i++;
		}
		i=0;
		while(i<strlen(c2))
		{
			if(c2[i]!='0')
			{
				count++;
			}
			i++;
		}
		cout<<count<<endl;
		count=0;

	}
}