#include <iostream>
#include<iomanip>

using namespace std;
 int main()
 {
	 
	 int a,b,sum, counter;
	 
	  while (sum!=0)
	 {
		 cin >>a >>b;
	 
	      sum=a+b;

		   sum=sum/10;

	       counter++;
	 
	 }
	  cout <<counter<<endl;
 }