#include <stdio.h>

int main(void)
{
	int a,b;
	char num[1000];
	int i=0;
	int count=0;
	
	scanf("%d %d",&a,&b);
	
	snprintf(num,1000, "%d", a+b);
	
	for(i=0;i<1000;i++)
	{
		if(num[i] == 0)
		{
			goto result;
		}
	}
	
	result:
	
	printf("%d\n",i);
	
	return 0;
	
}