#include<iostream>
using namespace std;
int main(){
  int a[3];
  int b[3];
  int ans;
  for(int i=0;i<3;i++){
    cin >> a[i] >> b[i];
    ans = a[i] + b[i];
    if(ans>=0 && ans<=99){
      cout << "2" <<endl;
    }
    if(ans>=100 && ans<=999){
      cout << "3" <<endl;
    }
    if(ans>=1000 && ans<=1999){
      cout << "4" <<endl;
    }
  }
  return 0;
}