#include <cstdio>
??????
#define MAX 1000000
#define MIN 0
#define SIZE 200
??????
int main() {
??int i,j;
??int a,b;
??int cnt = 0;
??int buf = 0;
??int sets[SIZE];
??????
??while(scanf("%d %d",&a,&b) != EOF) {
????if((a < MIN) || (b > MAX)) {
??????continue;
????}
????????
????sets[cnt] = a + b;
????++cnt;
??}
????
??for(i = 0;i <= cnt;++i) {
????j = MAX;
??
????while(j != 0) {
??????if((sets[i] / j) != 0) {
????????++buf;
????????sets[i] -= (sets[i] / j) * j;
??????}
??????
??????j /= 10;
????}
????
  sets[i] = buf;
????buf = 0;
??}
????
??for(i = 0;i <= cnt;++i) {
????printf("%d\n",sets[i]);
??}
????
??return 0;
}