/**/
//===============================================
#include <iostream>
using namespace std;
int counter=0;
//===============================================
int main()
{
	unsigned int n,i,m;
	for(;cin>>n,cin>>m;)
	{
		for(i=n;i;i=i/10)
		{
			if(i%10 != 0)
				counter++;
		}
		for(i=m;i;i=i/10)
		{
			if(i%10 != 0)
				counter++;
		}
		cout<<counter<<endl;
		counter=0;
	}
	return 0;
}