#include<iostream>
using namespace std;

int main(){
	int a,b,i,sum=1;
	cin>>a;
	while(a != EOF){
		cin>>b;	
		a=a+b;
		while(a>10){
			a=a%10;
			sum++;
		}
		cout<<sum<<endl;
		sum=0;
		cin>>a;
	}
    return 0;
}