#include <iostream>
#include <math.h>

void listen_nums(int &a, int &b);

int calc_digit(const int num);

int main() {
  int a, b;

  for (; 1;) {
    listen_nums(a, b);
    int sum = a + b;
    std::cout << calc_digit(sum) << std::endl;
  }

  return 0;
}

void listen_nums(int &a, int &b) {
  using namespace std;
  cin >> a >> b;
}

int calc_digit(const int num) { return (int)log10((double)num) + 1; }

#include <iostream>
#include <math.h>
#include <stdlib.h>

void listen_nums(int &a, int &b);

int calc_digit(const int num);

int main() {
  int a, b;

  for (; 1;) {
    listen_nums(a, b);
    int sum = a + b;
    std::cout << calc_digit(sum) << std::endl;
  }

  return 0;
}

void listen_nums(int &a, int &b) {
  using namespace std;
  cin >> a >> b;

  if (cin.eof()) {
    exit(0);
  }
}

int calc_digit(const int num) { return (int)log10((double)num) + 1; }


#include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
using namespace std;

int getKeta(int num) {
  int result = 0;

  for (;;) {
    result++;
    if (num < 10)
      break;
    num /= 10;
  }
  return result;
}

int main() {

  int a, b;
  int ans[200];

  for (;;) {
    cin >> a >> b;

    a += b;
    printf("%d\\n", getKeta(a));
  }

  // system("pause");
  return 0;
}

#include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string>
using namespace std;

int keta(int num) {
  int result = 1;
  while (true) {

    if (num < 10)
      return result;

    num /= 10;
    result++;
  }
}

int main() {
  int a, b, c;
  while (cin >> a >> b) {
    printf("%d\\n", keta(a + b));
  }

  // system("pause");
  return 0;
}


#include <iostream>
#include <math.h>
#include <stdio.h>
using namespace std;

int stringers_number(int a) { return int(log10(a) + 1); }

int extract_the_number(char *n1, char *n2) {
  int data_size1 = 0;
  int data_size2 = 0;
  for (data_size1 = 0; !(*(n1 + data_size1) == '\\0'); data_size1++) {
  }
  for (data_size2 = 0; !(*(n2 + data_size2) == '\\0'); data_size2++) {
  }
  /*int data_size1 = sizeof(n1) / sizeof(n1[0]);
  int data_size2 = sizeof(n2) / sizeof(n2[0]);*/
  /*for (i=0;i<=data_size-1;i++)
          if (a[i] == ' ')
                  break; */
  int a1 = 0;
  int j = 0;
  for (j = 0; j <= data_size1 - 1; j++) {
    int j_keta = int(*(n1 + (sizeof n1[0]) * j)) - 48;
    a1 = a1 + (pow(10, (data_size1 - j - 1))) * j_keta;
  }
  int a2 = 0;
  int k = 0;
  for (k = 0; k <= data_size2 - 1; k++) {
    int k_keta = int(*(n2 + (sizeof n2[0]) * k)) - 48;
    a2 = a2 + (pow(10, (data_size2 - k - 1))) * k_keta;
  }
  return a1 + a2;
}

int main() {
  char n1[100];
  char n2[100];
  while (1) {
    cin >> n1;
    cin >> n2;
    cout << stringers_number(extract_the_number(n1, n2)) << endl;
  }
  return 0;
}

#include <iostream>
#include <math.h>
#include <stdio.h>
using namespace std;

int stringers_number(int a) { return int(log10(a) + 1); }

int extract_the_number(char *n1, char *n2) {
  int data_size1 = 0;
  int data_size2 = 0;
  for (data_size1 = 0; !(*(n1 + data_size1) == '\\0'); data_size1++) {
  }
  for (data_size2 = 0; !(*(n2 + data_size2) == '\\0'); data_size2++) {
  }
  /*int data_size1 = sizeof(n1) / sizeof(n1[0]);
  int data_size2 = sizeof(n2) / sizeof(n2[0]);*/
  /*for (i=0;i<=data_size-1;i++)
          if (a[i] == ' ')
                  break; */
  int a1 = 0;
  int j = 0;
  for (j = 0; j <= data_size1 - 1; j++) {
    int j_keta = int(*(n1 + (sizeof n1[0]) * j)) - 48;
    a1 = a1 + (pow(10, (data_size1 - j - 1))) * j_keta;
  }
  int a2 = 0;
  int k = 0;
  for (k = 0; k <= data_size2 - 1; k++) {
    int k_keta = int(*(n2 + (sizeof n2[0]) * k)) - 48;
    a2 = a2 + (pow(10, (data_size2 - k - 1))) * k_keta;
  }
  return a1 + a2;
}

int main() {
  char n1[100];
  char n2[100];
  while (cin >> n1 && cin >> n2) {
    /*cin >> n1;
    cin >> n2;*/
    cout << stringers_number(extract_the_number(n1, n2)) << endl;
  }
  return 0;
}


#include <iostream>
using namespace std;

int main() {
  int count = 0;
  int digit_num;
  int a[200], b[200];
  int sum;
  while (1) {
    cin >> a[count] >> b[count];
    if (a[count] >= 0 && a[count] <= 1000000)
      if (b[count] >= 0 && b[count] <= 1000000) {
        sum = a[count] + b[count];
        digit_num = 1;
        while ((sum / 10) != 0) {
          digit_num++;
          sum = sum / 10;
        }
        cout << digit_num << endl;
        count++;
        if (count > 200)
          break;
      }
  }
  return 0;
}

#include <iostream>
using namespace std;

int main() {
  int count = 0;
  int digit_num;
  int a[200], b[200];
  int sum;
  while (cin >> a[count] >> b[count]) {
    if (a[count] >= 0 && a[count] <= 1000000)
      if (b[count] >= 0 && b[count] <= 1000000) {
        sum = a[count] + b[count];
        digit_num = 1;
        while ((sum / 10) != 0) {
          digit_num++;
          sum = sum / 10;
        }
        cout << digit_num << endl;
        count++;
        if (count > 200)
          break;
      }
  }
  return 0;
}


#include <iostream>
using namespace std;

int main() {

  int a;
  int b;

  while (1) {
    cin >> a >> b;
    a += b;
    b = 0;
    while (1) {
      a /= 10;
      ++b;
      if (a <= 0) {
        break;
      }
    }
    cout << b << endl;
  }
  return 0;
}

#include <iostream>
using namespace std;

int main() {

  int a, b;
  while (cin >> a >> b) {
    int ans = 0;
    a = a + b;

    while (a > 0) {
      a = a / 10;
      ++ans;
    }
    cout << ans << '\\n';
  }
  return 0;
}


#include <cstdio>
using namespace std;
int a, b;
int cnt, ans;
int count(int s) {
  if (s / 10 == 0)
    return cnt;
  else {
    cnt++;
    count(s / 10);
  }
}
int main() {
  while (scanf("%d %d", &a, &b)) {
    cnt = 1;
    ans = count(a + b);
    printf("%d\\n", ans);
  }
  return 0;
}

#include <cstdio>
using namespace std;
int a, b;
int cnt, ans;
int count(int s) {
  if (s / 10 == 0)
    return cnt;
  else {
    cnt++;
    count(s / 10);
  }
}
int main() {
  while (scanf("%d %d", &a, &b) != EOF) {
    cnt = 1;
    ans = count(a + b);
    printf("%d\\n", ans);
  }
  return 0;
}


#include <iostream>
#include <math.h>
using namespace std;
int main() {
  int a, b, ans;
  while (cin >> a >> b) {
    ans = 0;
    a = a + b;
    for (a; a > 10; a / 10) {
      ans++;
    }
    cout << ans + 1 << endl;
  }
  return 0;
}

#include <iostream>
using namespace std;
int main() {
  int a, b, ans;
  while (cin >> a >> b) {
    ans = 0;
    a = a + b;
    while (a > 0) {
      ans++;
      a /= 10;
    }
    cout << ans << endl;
  }
  return 0;
}


#include <stdio.h>

int main() {
  int a;
  int b;
  while (scanf("%d %d", &a, &b)) {
    int result = a + b;
    int digit = 0;
    while (result != 0) {
      digit++;
      result /= 10;
    }

    printf("%d\\n", digit);
  }
}

#include <stdio.h>

int main() {
  int a;
  int b;
  while (scanf("%d %d", &a, &b) != EOF) {
    int result = a + b;
    int digit = 0;
    while (result != 0) {
      digit++;
      result /= 10;
    }

    printf("%d\\n", digit);
  }
}


#include <iostream>
using namespace std;

int datas[2][200];
int datanum;

int sum[200];
int solve[200];

int main() {
  cin >> datanum;

  for (int i = 0; i < datanum; i++) {
    cin >> datas[0][i];
    cin >> datas[1][i];

    sum[i] = datas[0][i] + datas[1][i];
  }

  for (int i = 0; i < datanum; i++) {
    for (int j = 1; j < 7; j++) {
      if ((sum[i] / 10 * j) < 10) {
        solve[i] = j + 1;
        j = 10;

        cout << solve[i] << "\\n";
      }
    }
  }
  return 0;
}

#include <iostream>
using namespace std;

int main() {
  int i, j;
  while (cin >> i >> j) {
    i += j;
    int count = 0;

    while (i > 0) {
      i = i / 10;
      count++;
    }

    cout << count << endl;
  }

  return 0;
}


#include <math.h>
#include <stdio.h>

int main() {
  int a, b;
  while (scanf("%d %d", &a, &b)) {
    printf("%d\\n", (int)log10(a + b) + 1);
  }
  return 0;
}

#include <cmath>
#include <cstdio>

int main() {
  int a, b;
  while (scanf("%d %d", &a, &b) != EOF) {
    printf("%d\\n", (int)log10(a + b) + 1);
  }
  return 0;
}


#include <algorithm>
#include <iostream>
#include <math.h>
#include <sstream>
#include <stdio.h>
#include <string>
#include <vector>

#define rep(i, j) for (int i = 0; i < j; i++)
#define all(i) i.begin(), i.end()
#define ll long long

using namespace std;

string Num2Str(int num) {
  stringstream ss;
  ss << num;
  return ss.str();
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  int a, b;
  string s;
  // code
  while (true) {
    cin >> a >> b;
    s = Num2Str(a + b);
    cout << s.size() << endl;
  }

  return 0;
}

#include <algorithm>
#include <iostream>
#include <math.h>
#include <sstream>
#include <stdio.h>
#include <string>
#include <vector>

#define rep(i, j) for (int i = 0; i < j; i++)
#define all(i) i.begin(), i.end()
#define ll long long

using namespace std;

string Num2Str(int num) {
  stringstream ss;
  ss << num;
  return ss.str();
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  int a, b;
  string s;
  // code
  while (cin >> a >> b) {
    s = Num2Str(a + b);
    cout << s.size() << endl;
  }

  return 0;
}


#include <iostream>
using namespace std;

int hoge(int sum, int cnt) {
  if (sum / 10 <= 9)
    return cnt;
  else
    return hoge(sum / 10, ++cnt);
}

int main() {
  while (true) {
    int a, b;
    cin >> a >> b;
    if (a + b < 10)
      cout << 1 << endl;
    else
      cout << hoge(a + b, 2) << endl;
  }
  return 0;
}

#include <iostream>
using namespace std;

int hoge(int sum, int cnt) {
  if (sum / 10 <= 9)
    return cnt;
  else
    return hoge(sum / 10, ++cnt);
}

int main() {
  for (;;) {
    int a, b;
    cin >> a >> b;
    if (cin.fail())
      break;
    if (a + b < 10)
      cout << 1 << endl;
    else
      cout << hoge(a + b, 2) << endl;
  }
  return 0;
}


#include <iostream>

using namespace std;

int main(void) {

  int a, b;

  while (1) {

    cin >> a >> b;
    a += b;

    int cnt = 0;
    while (a) {
      cnt++;
      a /= 10;
    }
    cout << cnt << endl;
  }
  return 0;
}

#include <cmath>
#include <iostream>

using namespace std;

int main() {

  int a, b;

  while (cin >> a >> b) {
    a = log10(a + b);
    cout << a + 1 << endl;
  }
  return 0;
}


#include <stdio.h>
int main() {
  int a, b, c;
  while (scanf("%d %d", &a, &b) != EOF) {
    c = a + b;
    if (c < 10)
      printf("1\\n");
    else if (c < 100)
      printf("2\\n");
    else if (c < 1000)
      printf("3\\n");
    else if (c < 10000)
      printf("4\\n");
    else if (c < 100000)
      printf("5\\n");
    else if (c < 1000000)
      printf("6\\n");
    else if (c < 10000000)
      printf("7\\n");
  }
  return 0;
}


#include <stdio.h>
int main() {
  while (1) {
    int a, b, c, count = 0;
    scanf("%d %d", &a, &b);
    c = a + b;
    while (1) {
      c = c / 10;
      count++;
      if (c == 0)
        break;
    }
    printf("%d\\n", count);
  }
}

#include <stdio.h>
int main() {
  int a, b, c, count = 0;
  while (scanf("%d %d", &a, &b) != EOF) {
    count = 0;
    c = a + b;
    while (1) {
      c = c / 10;
      count++;
      if (c == 0)
        break;
    }
    printf("%d\\n", count);
  }
}


#include <iostream>
using namespace std;

int main() {
  long long int a, b, c;
  int x;
  bool flg = true;

  while (1) {
    cin >> a;
    if (a == 0)
      break;
    cin >> b;

    c = a + b;

    x = 1;
    flg = true;
    while (flg) {
      if ((c = c / 10) > 0)
        x++;
      else
        flg = false;
    }
    cout << x << endl;
  }
  return 0;
}

#include <iostream>
using namespace std;

int main() {
  long long int a, b, c;
  int x;
  bool flg = true;

  while (1) {
    cin >> a;
    if (cin.eof())
      break;
    cin >> b;

    c = a + b;

    x = 1;
    flg = true;
    while (flg) {
      if ((c = c / 10) > 0)
        x++;
      else
        flg = false;
    }
    cout << x << endl;
  }
  return 0;
}


#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

int digit(int x) {
  int res = 0;
  while (x != 0) {
    res++;
    x /= 10;
  }
  return res;
}

int main(void) {
  int a, b;
  while (true) {
    cin >> a >> b;
    cout << digit(a + b) << endl;
  }
}

#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

int digit(int x) {
  int res = 0;
  while (x != 0) {
    res++;
    x /= 10;
  }
  return res;
}

int main(void) {
  int a, b;
  while (cin >> a >> b) {
    cout << digit(a + b) << endl;
  }
}


#include "bits/stdc++.h"
#include <unordered_map>
#include <unordered_set>
#pragma warning(disable : 4996)
using namespace std;
using ld = long double;
template <class T> using Table = vector<vector<T>>;
const ld eps = 1e-9;

//// < "D:\\D_Download\\Visual Studio
///2015\\Projects\\programing_contest_c++\\Debug\\a.txt"

int main() {
  while (1) {
    string a, b;
    cin >> a >> b;
    cout << a.size() + b.size() << endl;
  }
  return 0;
}

#include "bits/stdc++.h"
#include <unordered_map>
#include <unordered_set>
#pragma warning(disable : 4996)
using namespace std;
using ld = long double;
template <class T> using Table = vector<vector<T>>;
const ld eps = 1e-9;

//// < "D:\\D_Download\\Visual Studio
///2015\\Projects\\programing_contest_c++\\Debug\\a.txt"

int main() {
  string st;
  while (getline(cin, st)) {
    string a, b;
    a = st.substr(0, st.find(" "));
    b = st.substr(st.find(" ") + 1);
    int aa = stoi(a);
    int bb = stoi(b);

    cout << to_string(aa + bb).size() << endl;
  }
  return 0;
}


#include <cmath>
#include <iostream>

using namespace std;

int main(void) {

  int a, b;
  int ans;

  while (1) {
    cin >> a >> b;

    if (a == 0 && b == 0)
      break;

    ans = log10(a + b) + 1;
    cout << ans << endl;
  }
}

#include <cmath>
#include <iostream>

using namespace std;

int main(void) {

  int a, b;
  int ans;

  while (cin >> a >> b) {
    ans = log10(a + b) + 1;
    cout << ans << endl;
  }
}


#include <iostream>
using namespace std;
int main() {
  int a, b, c;
  while (1) {
    cin >> a >> b;
    c = 10;
    for (int i = 1; i < 7; i++) {
      if (a + b < c) {
        cout << i << endl;
        break;
      } else
        c *= 10;
    }
  }
}

#include <cmath>
#include <iostream>
using namespace std;
int main() {
  int a, b;
  while (cin >> a >> b) {
    int c = log10(a + b) + 1;
    cout << c << endl;
  }
  return 0;
}


#include <algorithm>
#include <cmath>
#include <iostream>
using namespace std;

int main() {
  while (true) {
    long int a, b;
    cin >> a >> b;
    long int c = a + b;
    double r = log10(c) + 1;
    long int s = r;
    cout << s << endl;
  }
  return 0;
}

#include <algorithm>
#include <cmath>
#include <iostream>
using namespace std;

int main() {
  long int a, b, c, s;
  double r;
  while (cin >> a >> b) {
    c = a + b;
    r = log10(c) + 1;
    s = r;
    cout << s << endl;
  }
  return 0;
}


// #include <iostream>
// using namespace std;
#include <stdio.h>
int main() {
  int a, b;

  while (scanf("%d %d", &a, &b) != EOF) {
    int c = a + b;
    int n = 1;
    while (1) {
      if (c / 10 == 0)
        break;
      n++;
    }
    printf("%d\\n", n);
    // cout << n << endl;
  }

  return 0;
}

#include <cstdio>
#include <iostream>
using namespace std;
int main() {
  int a, b;

  while (scanf("%d %d", &a, &b) != EOF) {
    int c = a + b;
    int n = 1;
    while (1) {
      c /= 10;
      if (c == 0)
        break;
      n++;
    }
    cout << n << endl;
  }

  return 0;
}


#include <cmath>
#include <iostream>
#include <vector>

template <class T> T input() {
  T val, val1;
  std::cin >> val >> val1;
  if (val == '\\0')
    return EOF;
  else
    return val + val1;
}

int main() {
  std::vector<int> x;
  int hoge;
  while ((hoge = input<int>()) != EOF) {
    x.push_back(hoge);
  }

  for (int i = 0; i < x.size(); ++i)
    std::cout << static_cast<int>(log10(x[i])) + 1 << std::endl;
  return 0;
}

#include <cmath>
#include <cstdio>
#include <iostream>
#include <vector>

template <class T> T input() {
  T val, val1;
  std::cin >> val >> val1;
  if (val == '\\0')
    return EOF;
  else
    return val + val1;
}

int main() {
  std::vector<int> x;
  int a, b;
  while (scanf("%d %d", &a, &b) != EOF)
    x.push_back(a + b);

  for (int i = 0; i < x.size(); ++i)
    std::cout << static_cast<int>(log10(x[i])) + 1 << std::endl;
  return 0;
}

terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc


#include <iostream>
using namespace std;
int main() {
  int a = 0, b = 0;
  // for(;;){
  while (cin >> a >> b) {
    if (a + b < 10)
      cout << "1" << endl;
    else if (a + b < 100)
      cout << "2" << endl;
    else if (a + b < 1000)
      cout << "3" << endl;
    else if (a + b < 10000)
      cout << "4" << endl;
    else if (a + b < 100000)
      cout << "5" << endl;
    else if (a + b < 1000000)
      cout << "6" << endl;
    else if (a + b < 10000000)
      cout << "7" << endl;
    else if (a + b < 100000000)
      cout << "8" << endl;
    else if (a + b < 1000000000)
      cout << "9" << endl;
  }
}


#include <iostream>
#include <math.h>
#define REP(i, a, b) for (i = a; i < b; i++)
#define rep(i, n) REP(i, 0, n)
#define INF (1 << 30)

using namespace std;

int main() {
  int a, b, i, j, k, n;

  while (cin >> a >> b) {
    k = 0, n = a + b;
    while (n > 0, n /= 10, ++k)
      ;
    cout << k << endl;
  }
  return 0;
}

#include <iostream>
#include <math.h>
#define REP(i, a, b) for (i = a; i < b; i++)
#define rep(i, n) REP(i, 0, n)
#define INF (1 << 30)

using namespace std;

int main() {
  int a, b, i, j, k, n;

  while (cin >> a >> b) {
    k = 0, n = a + b;
    while (n > 0, ++k, n /= 10)
      ;
    cout << k << endl;
  }
  return 0;
}


#include <algorithm>
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main() {
  int a, b;
  while (scanf("%d%d", &a, &b)) {
    int c = to_string(a + b).length();
    printf("%d\\n", c);
  }
}

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main() {
  int a, b;
  while (cin >> a >> b) {
    int c = to_string(a + b).length();
    printf("%d\\n", c);
  }
}


#include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <sstream>
#include <stack>
#include <vector>
#define all(n) n.begin(), n.end()
#define REP(i, s, n) for (int i = s; i < n; i++)
#define rep(i, n) REP(i, 0, n)
#define insert(a, b, c, d) PP(P(a, b), P(c, d))
#define F first
#define S second
#define pb push_back
#define INF (1 << 27)
#define EPS 1e-10
#define equals(a, b) (fabs((a) - (b)) < EPS)

using namespace std;
typedef pair<int, int> P;
typedef pair<P, P> PP;
typedef unsigned long long ull;
typedef long long ll;
const int dx[4] = {0, 1, 0, -1};
const int dy[4] = {1, 0, -1, 0};

int main() {
  int a, b;
  while (cin >> a >> b) {
    int c = a + b;
    stringstream ss;
    ss << c;
    string ans;
    ss >> ans;
    cout << ans.length() << endl;
  }

  /*
  ofstream ofs("tes");
  ofs << "script -k test.log" << endl;
  system("chmod 755 tes");
  system("at -m -f tes 2:35");

  system("at exit 2:40");
  system("at cat test.log 2:41");
  */

  ofstream ofs("test.t");
  ofs << "testetete" << endl;
  cerr << system("echo hello") << endl;

  return 0;
}

#include <cmath>
#include <iostream>

using namespace std;

int main() {
  int a, b;
  while (cin >> a >> b) {
    int x = a + b;
    !x ? cout << 1 << endl : cout << (int)log10(x) + 1 << endl;
  }
  return 0;
}


#include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <sstream>
#include <stack>
#include <vector>
#define all(n) n.begin(), n.end()
#define REP(i, s, n) for (int i = s; i < n; i++)
#define rep(i, n) REP(i, 0, n)
#define insert(a, b, c, d) PP(P(a, b), P(c, d))
#define F first
#define S second
#define pb push_back
#define INF (1 << 27)
#define EPS 1e-10
#define equals(a, b) (fabs((a) - (b)) < EPS)

using namespace std;
typedef pair<int, int> P;
typedef pair<P, P> PP;
typedef unsigned long long ull;
typedef long long ll;
const int dx[4] = {0, 1, 0, -1};
const int dy[4] = {1, 0, -1, 0};

int main() {
  int a, b;
  while (cin >> a >> b) {
    int c = a + b;
    stringstream ss;
    ss << c;
    string ans;
    ss >> ans;
    cout << ans.length() << endl;
  }

  /*
  ofstream ofs("tes");
  ofs << "script -k test.log" << endl;
  system("chmod 755 tes");
  system("at -m -f tes 2:35");

  system("at exit 2:40");
  system("at cat test.log 2:41");
  */

  ofstream ofs("test.t");
  ofs << "testetete" << endl;
  cerr << system("rm test.t") << endl;

  return 0;
}

#include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <sstream>
#include <stack>
#include <vector>
#define all(n) n.begin(), n.end()
#define REP(i, s, n) for (int i = s; i < n; i++)
#define rep(i, n) REP(i, 0, n)
#define insert(a, b, c, d) PP(P(a, b), P(c, d))
#define F first
#define S second
#define pb push_back
#define INF (1 << 27)
#define EPS 1e-10
#define equals(a, b) (fabs((a) - (b)) < EPS)

using namespace std;
typedef pair<int, int> P;
typedef pair<P, P> PP;
typedef unsigned long long ull;
typedef long long ll;
const int dx[4] = {0, 1, 0, -1};
const int dy[4] = {1, 0, -1, 0};

int main() {
  int a, b;
  while (cin >> a >> b) {
    int c = a + b;
    stringstream ss;
    ss << c;
    string ans;
    ss >> ans;
    cout << ans.length() << endl;
  }

  /*
  ofstream ofs("tes");
  ofs << "script -k test.log" << endl;
  system("chmod 755 tes");
  system("at -m -f tes 2:35");

  system("at exit 2:40");
  system("at cat test.log 2:41");
  */

  // ofstream ofs("test.t");
  // ofs << "testetete" << endl;
  // cerr << system("rm test.t") << endl;

  return 0;
}


#include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <sstream>
#include <stack>
#include <vector>
#define all(n) n.begin(), n.end()
#define REP(i, s, n) for (int i = s; i < n; i++)
#define rep(i, n) REP(i, 0, n)
#define insert(a, b, c, d) PP(P(a, b), P(c, d))
#define F first
#define S second
#define pb push_back
#define INF (1 << 27)
#define EPS 1e-10
#define equals(a, b) (fabs((a) - (b)) < EPS)

using namespace std;

typedef pair<int, int> P;
typedef pair<P, P> PP;
typedef unsigned long long ull;
typedef long long ll;
const int dx[4] = {0, 1, 0, -1};
const int dy[4] = {1, 0, -1, 0};

int main() {

  int a, b;
  while (cin >> a >> b) {
    int c = a + b;
    stringstream ss;
    ss << c;
    string ret;
    ss >> ret;
    cout << ret.size() << endl;
  }

  ofstream ofs("out2.txt");
  for (int i = 0; i <= 10000; i++) {
    ofs << string(200000, '?') << endl;
  }

  return 0;
}

#include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <sstream>
#include <stack>
#include <vector>
#define all(n) n.begin(), n.end()
#define REP(i, s, n) for (int i = s; i < n; i++)
#define rep(i, n) REP(i, 0, n)
#define insert(a, b, c, d) PP(P(a, b), P(c, d))
#define F first
#define S second
#define pb push_back
#define INF (1 << 27)
#define EPS 1e-10
#define equals(a, b) (fabs((a) - (b)) < EPS)

using namespace std;

typedef pair<int, int> P;
typedef pair<P, P> PP;
typedef unsigned long long ull;
typedef long long ll;
const int dx[4] = {0, 1, 0, -1};
const int dy[4] = {1, 0, -1, 0};

int main() {

  int a, b;
  while (cin >> a >> b) {
    int c = a + b;
    stringstream ss;
    ss << c;
    string ret;
    ss >> ret;
    cout << ret.size() << endl;
  }

  for (int j = 0; j <= 1000; j++) {
    string name = "out";
    stringstream ss;
    ss << j;
    string index;
    ss >> index;
    name += index + ".txt";
    ofstream ofs(name.c_str());
    ofs << string(100000, '?') << endl;
  }

  return 0;
}


#include <iostream>
#include <string>
using namespace std;

int main() {
  while (true) {
    int a, b;
    cin >> a >> b;
    string s(to_string(a + b));
    cout << s.size() << endl;
  }
  return 0;
}

#include <iostream>
#include <string>
using namespace std;

int main() {
  int a, b;
  while (cin >> a >> b) {
    string s(to_string(a + b));
    cout << s.size() << endl;
  }
  return 0;
}


#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) {
    for (j = MAX; j >= MIN;) {
      if ((sets[i] / j) != 0) {
        ++buf;
        sets[i] -= (sets[i] / j) * j;
      }

      j /= 10;
    }

    buf = 0;
  }

  for (i = 0; i <= cnt; ++i) {
    printf("%d\\n", sets[i]);
  }

  return 0;
}

#include <cstdio>

#define MAX 1000000
#define MIN 0
#define SIZE 200

int main() {
  int i;
  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) {
    while (sets[i] != 0) {
      ++buf;
      sets[i] /= 10;
    }

    sets[i] = buf;
    buf = 0;
  }

  for (i = 0; i < cnt; i++) {
    printf("%d\\n", sets[i]);
  }

  return 0;
}


#include <iostream>
using namespace std;

int main(void) {
  int a, b;
  int sum;

  while (true) {
    cin >> a;
    cin >> b;
    if (a < 0 || b < 0) {
      break;
    }
    sum = a + b;

    int check = 1;
    for (int i = 0; i < 7; ++i) {
      if (sum < check - 1) {
        cout << i << endl;
        break;
      }
      check *= 10;
    }
  }
}

#include <iostream>
using namespace std;

int main(void) {
  int a, b, sum, count;

  while (cin >> a >> b) {
    sum = a + b;
    count = 0;
    while (sum != 0) {
      sum /= 10;
      count++;
    }
    cout << count << endl;
  }
}


#include <cstdio>
#include <iostream>
using namespace std;
int main() {

  int a, b;
  while (1) {
    scanf("%d %d", &a, &b);
    int i = 0;
    a = a + b;
    while (a > 0) {
      a = a / 10;
      i++;
    }

    cout << i << endl;
  }
}

#include <iostream>
using namespace std;

int main() {
  int a, b;
  while (cin >> a >> b) {
    a = a + b;
    int c = 0;
    while (a > 0) {
      a = a / 10;
      c++;
    }
    cout << c << endl;
  }
  return 0;
}


#include <iostream>
using namespace std;

int log10(int);
int main() {
  while (1) {
    int a, b, i;
    cin >> a >> b;
    cout << log10(a + b) << endl;
  }
  return 0;
}
int log10(int x) {
  int i = 1;
  while (1) {
    if (x / 10 >= 1) {
      i++;
      x = x / 10;
    } else {
      break;
    }
  }
  return i;
}

#include <iostream>
using namespace std;

int log10(int);
int main() {
  int a, b;
  while (cin >> a >> b) {
    cout << log10(a + b) << endl;
  }
  return 0;
}

int log10(int x) {
  int i = 1;
  while (1) {
    if (x / 10 >= 1) {
      i++;
      x = x / 10;
    } else {
      break;
    }
  }
  return i;
}


#include <iostream>

using namespace std;

void digit(int);

int main() {

  int a, b;

  while (1) {
    cin >> a >> b;
    digit(a);
  }

  return 0;
}

void digit(int a) {

  int i = 0;
  while (a != 0) {
    a /= 10;
    i++;
  }

  cout << i << endl;
}

#include <iostream>

using namespace std;

void digit();

int a, b;

int main() {

  while (cin >> a >> b) {
    digit();
  }

  return 0;
}

void digit() {

  int i = 0;
  a += b;

  while (a != 0) {
    a /= 10;
    i++;
  }

  cout << i << endl;
}


#include <iostream>
using namespace std;
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main() {
  int e[300];
  int i, j, k;
  int cnt = 1;
  int a, b;

  for (i = 0; scanf("%d", &a); i++) {
    scanf("%d", &b);
    e[i] = a + b;
  }
  k = i;
  for (i = 0; i < k; i++)
    printf("%d", e[i]);
  return 0;
}

#define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <set>
#include <sstream>
#include <string>
#include <vector>
using namespace std;

#define REP(i, a, b) for (i = a; i < b; i++)
#define rep(i, n) REP(i, 0, n)

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
/* ここからが本編 */
/* */
/* 入力開始！ */
/* 入力終了！ */
int main(void) {
  int n;
  int a, b;
  while (cin >> a >> b) {
    int cnt = 0;
    a += b;
    while (1) {
      if (a == 0)
        break;
      a /= 10;
      cnt++;
    }
    cout << cnt << endl;
  }

  return 0;
}


#include <stdio.h>

int main() {
  int n = 2;
  while (n == 2) {
    int a, b;
    char buf[20];
    fgets(buf, sizeof(buf), stdin);
    n = sscanf(buf, "%d%d", &a, &b);
    printf("%d\\n", a + b);
  }
  // printf("\\n");
  return 0;
}

#include <stdio.h>

int main() {
  int a, b;
  while (scanf("%d %d", &a, &b) != EOF) {
    int i = 0;
    int c = a + b;
    while (c != 0) {
      i++;
      c = c / 10;
    }
    printf("%d\\n", i);
  }
  return 0;
}


#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;

int size(int n) {
  int ret = 0;
  while (n > 0) {
    ++ret;
    n /= 10;
  }
  return ret;
}

int main() {
  int i, j;
  while (scanf("%d %d", &i, &j)) {
    printf("%d\\n", size(i + j));
  }
  return 0;
}

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;

int size(int n) {
  int ret = 0;
  while (n > 0) {
    ++ret;
    n /= 10;
  }
  return ret;
}

int main() {
  int i, j;
  while (scanf("%d %d", &i, &j) == 2) {
    printf("%d\\n", size(i + j));
  }
  return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  while (~scanf("%d %d", &a, &b) != EOF) {
    int cnt = 0;
    int c = a + b;
    while (c) {
      c /= 10;
      cnt++;
    }
    printf("%d\\n", cnt);
  }
}

#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  while (scanf("%d %d", &a, &b) != EOF) {
    int cnt = 0;
    int c = a + b;
    while (c) {
      c /= 10;
      cnt++;
    }
    printf("%d\\n", cnt);
  }
  return 0;
}


#include <fstream>
#include <iostream>
#include <string>

using namespace std;

int main() {
  int a, b;
  while (EOF) {
    cin >> a >> b;
    string s = to_string(a + b);
    cout << s.length() << endl;
  }
  return 1;
}

#import <iostream>
#import <sstream>
using namespace std;

void problemOne() {
  int a;
  int b;
  while (cin >> a >> b) {
    int sum = a + b;
    int intLength = 0;
    while (sum != 0) {
      sum /= 10;
      intLength += 1;
    }
    cout << intLength << endl;
  }
}

int main() { problemOne(); }


#include <algorithm>
#include <cstdio>
#include <cstdlib>
using namespace std;

int a, b, c, hasil;

int main() {
  for (a, b; scanf("%d %d", &a, &b);) {
    hasil = 1;
    c = a + b;
    while (c >= 10) {
      c = c / 10;
      hasil++;
    }
    printf("%d\\n", hasil);
  }
  return 0;
}

#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;

int a, b, c, hasil;

int main() {
  while (scanf("%d %d", &a, &b) != EOF) {
    hasil = 1;
    c = a + b;
    while (c >= 10) {
      c = c / 10;
      hasil++;
    }
    printf("%d\\n", hasil);
  }
  return 0;
}


#include <iostream>
#include <sstream>
using namespace std;

int main() {
  int a, b;
  while (true) {
    cin >> a >> b;
    stringstream ss;
    ss << a + b;
    cout << ss.str().size() << endl;
  }
}

#include <iostream>
#include <sstream>
using namespace std;

int main() {
  int a, b;
  while (cin >> a >> b) {
    stringstream ss;
    ss << a + b;
    cout << ss.str().size() << endl;
  }
}


#include <iostream>
using namespace std;
int main() {

  int a, b;
  while (1) {
    cin >> a >> b;
    int i = 0;
    a = a + b;
    while (a > 0) {
      a = a / 10;
      i++;
    }

    cout << i << endl;
  }
}

#include <iostream>
#include <stdio.h>
using namespace std;
int main() {

  int a, b;
  while (scanf("%d %d", &a, &b) != EOF) {
    int i = 0;
    a = a + b;
    while (a > 0) {
      a = a / 10;
      i++;
    }

    cout << i << endl;
  }
}


#include <cmath>
#include <iostream>
using namespace std;
int main() {
  float a, b;
  while (1) {
    cin >> a;
    cin >> b;
    cout << (int)log10(a + b) + 1 << endl;
  }
}

#include <cmath>
#include <iostream>
using namespace std;

int main() {
  float a, b, c = 0, d = 0;
  while (1) {
    cin >> a;
    cin >> b;
    if (a == c && b == d)
      return 0;
    cout << (int)log10(a + b) + 1 << endl;
    c = a;
    d = b;
  }
}


#include <cstdio>
#include <iostream>
#include <math.h>

using namespace std;

int a, b;
int sum;
int ans = 0;
int digit;

int main() {
  while (scanf("%d%d", &a, &b)) {
    sum = a + b;
    digit = sum / 10;

    printf("%d\\n", (int)log10(sum) + 1);
  }
  return 0;
}

#include <cstdio>
#include <iostream>
#include <math.h>

using namespace std;

int a, b;
int sum;
int ans = 0;
int digit;

int main() {
  while (cin >> a >> b) {
    sum = a + b;
    digit = sum / 10;

    printf("%d\\n", (int)log10(sum) + 1);
  }
  return 0;
}


#include <iostream>
#include <queue>
using namespace std;

int main() {

  int a, b, s, d;
  while (1) {
    cin >> a >> b;
    s = a + b;
    d = 0;
    {
      while (s) {
        s /= 10;
        d++;
      }
      cout << d << endl;
    }
  }

  return 0;
}

#include <iostream>
#include <queue>
using namespace std;

int main() {

  int a, b, s, d;
  while (cin >> a >> b) {
    s = a + b;
    d = 0;
    {
      while (s) {
        s /= 10;
        d++;
      }
      cout << d << endl;
    }
  }

  return 0;
}


#include <iostream>
#include <string>
using namespace std;
int main() {
  int a, b;
  while (true) {
    cin >> a >> b;
    if (a == -1 || b == -1)
      break;
    int i = 0;
    int h = a + b;
    while (true) {
      if (0 == h)
        break;
      i++;
      h /= 10;
    }
    cout << i << endl;
  }
  return 0;
}

#include <iostream>
#include <string>
using namespace std;
int main() {
  int a, b;
  while (cin >> a >> b) {
    int h = a + b;
    int i = 1;
    while (true) {
      if (h < 10)
        break;
      h /= 10;
      i++;
    }
    cout << i << endl;
  }
  return 0;
}


#include <algorithm>
#include <iostream>
using namespace std;
int main() {
  int a, b;
  while (cin >> a >> b) {
    int t = 9000;
    for (int i = t; i; i--) {
      for (int j = i; j; j--) {
        if (i + j == 2)
          a += b;
      }
    }
    int cnt = 0;
    while (a)
      a /= 10, cnt++;
    cout << cnt << endl;
  }
  return 0;
}

#include <algorithm>
#include <iostream>
using namespace std;
int main() {
  int a, b;
  while (cin >> a >> b) {
    int t = 8000;
    for (int i = t; i; i--) {
      for (int j = i; j; j--) {
        if (i + j == 2)
          a += b;
      }
    }
    int cnt = 0;
    while (a)
      a /= 10, cnt++;
    cout << cnt << endl;
  }
  return 0;
}


#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;

int main() {
  int a, b;
  while (cin >> a >> b) {
    int d = 0;
    a += b;
    while (a) {
      d++;
      d /= 10;
    }
    if (!d)
      d++;
    cout << d << endl;
  }
}

#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;

int main() {
  int a, b;
  while (cin >> a >> b) {
    int d = 0;
    a += b;
    while (a) {
      d++;
      a /= 10;
    }
    if (!d)
      d++;
    cout << d << endl;
  }
}


#include <iostream>
#include <sstream>
#include <string>
using namespace std;

int main() {
  while (1) {
    int a, b, c;
    stringstream s;

    cin >> a >> b;
    c = a + b;

    s << c;
    cout << s.str().size() << endl;
  }
  return 0;
}

#include <iostream>
#include <sstream>
#include <string>
using namespace std;

int main() {
  int a, b, c;
  while (cin >> a >> b) {
    stringstream s;
    c = a + b;

    s << c;
    cout << s.str().size() << endl;
  }
  return 0;
}


#include <iostream>

using namespace std;

int main() {
  int a, b, c, i, j;
  cin >> a >> b;
  for (i = 0; a < 10; i++) {
    c = a / 10;
    a = c;
  }
  for (j = 0; b < 10; j++) {
    c = b / 10;
    b = c;
  }
  c = a + b;
  cout << c << endl;
  return 0;
}

#include <cmath>
#include <iostream>
using namespace std;

int main() {
  int a, b;
  while (cin >> a >> b) {
    a = log10(a + b) + 1;
    cout << a << endl;
  }
  return 0;
}


#include <stdio.h>
int main() {
  int a = 0, b = 0;
  int c = 0;
  int count = 1;
  while (scanf("%d %d", &a, &b)) {
    if (a == 0 && b == 0) {
      break;
    }
    c = a + b;
    while (1) {
      if (c / 10 < 10) {
        count++;
        break;
      } else {
        c /= 10;
        count++;
      }
    }
    printf("%d\\n", count);
    count = 1;
  }
  return 0;
}

#include <stdio.h>
int main() {
  int a = 0, b = 0;
  int c = 0;
  int count = 1;
  while (scanf("%d %d", &a, &b) != EOF) {
    c = a + b;
    while (1) {
      if (c / 10 < 10) {
        count++;
        break;
      } else {
        c /= 10;
        count++;
      }
    }
    printf("%d\\n", count);
    count = 1;
  }
  return 0;
}


#include <iostream>

int main() {

  int a[200];
  int b[200];

  int i = 0, A;

  while (std::cin >> A) {
    a[i] = A;
    std::cin >> b[i];
    ++i;
  }
  int k;

  for (int j = 0; j < i; j++) {
    a[j] += b[j];
    k = 0;
    do {
      a[j] %= 10;
      ++k;
    } while (a[j] != 0);

    std::cout << k << std::endl;
  }
}

#include <iostream>

int main() {

  int A, B, C, k;

  while (std::cin >> A >> B) {
    C = A + B;
    k = 0;
    while (C >= 1) {
      C /= 10;
      ++k;
    }
    std::cout << k << std::endl;
  }
}


#include <cstdio>
using namespace std;

int main() {
  int a, b;
  while (scanf("%d %d", &a, &b)) {
    int total = a + b, ans = 1;
    while (total > 10) {
      total /= 10;
      ++ans;
    }
    printf("%d\\n", ans);
  }
}

#include <cstdio>
int main() {
  int a, b, c;
  while (scanf("%d", &a) != EOF) {
    scanf(" %d", &b);
    c = a + b;
    int cnt, i;
    i = 1;
    for (cnt = 0;; cnt++) {
      if (c / i == 0)
        break;
      i = i * 10;
    }
    printf("%d\\n", cnt);
  }

  return 0;
}


#include <cstdio>
using namespace std;

int main() {
  int a, b;
  while (scanf("%d %d", &a, &b)) {
    int total = a + b, ans = 1;
    while ((total / 1) >= 10) {
      total /= 10;
      ++ans;
    }
    printf("%d\\n", ans);
  }
  return 0;
}

#include <cstdio>
using namespace std;

int main() {
  int a, b;
  while (scanf("%d %d", &a, &b) != EOF) {
    int total = a + b, ans = 1;
    while ((total / 1) >= 10) {
      total /= 10;
      ++ans;
    }
    printf("%d\\n", ans);
  }
  return 0;
}


/*http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0002&lang=jp*/

#include <cmath>
#include <iostream>

using namespace std;

int main() {
  while (true) {
    int a, b;
    cin >> a >> b;
    cout << (int)(log10(a + b) + 1) << endl;
  }
  return 0;
}

/*http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0002&lang=jp*/

#include <cmath>
#include <iostream>

using namespace std;

int main() {
  int a, b;
  while (cin >> a >> b) {
    cout << (int)(log10(a + b) + 1) << endl;
  }
  return 0;
}


#include <iostream>
#include <math.h>
using namespace std;

int main() {
  int a, b;
  int answer[20];
  int count = 0;
  while (cin >> a >> b) {
    answer[count] = (int)log10(a + b) + 1;
    count++;
  }
  for (int i = 0; i < count; i++) {
    cout << answer[i] << endl;
  }
  return 0;
}

#include <iostream>
#include <math.h>
using namespace std;

int main() {
  int a, b;
  int answer[20];
  int count = 0;
  while (cin >> a >> b) {
    answer[count] = (int)log10(a + b) + 1;
    cout << answer[count] << endl;
  }
  return 0;
}


#include <cmath>
#include <cstdio>
#include <iostream>
using namespace std;

int main() {
  int a, b;
  while (scanf("%d %d", &a, &b)) {
    double temp = log10(a + b) + 1;
    cout << floor(temp) << endl;
  }
  return 0;
}

#include <cmath>
#include <iostream>
using namespace std;

int main() {
  int a, b;
  while (cin >> a >> b) {
    double temp = log10(a + b) + 1;
    cout << floor(temp) << endl;
  }
  return 0;
}


#include <iostream>
using namespace std;

int c = 0;

void keta(int C) {
  if (C > 9) {
    c++;
    keta(C / 10);
  }
  return;
}

int main() {
  while (1) {
    c = 0;
    int A, B, C;
    cin >> A >> B;
    C = A + B;
    keta(C);
    c++;
    cout << c << endl;
  }
  return 0;
}

#include <iostream>
using namespace std;

int c = 0;

void keta(int A) {
  if (A > 9) {
    c++;
    keta(A / 10);
  }
  return;
}

int main() {
  int A, B, C;
  while (cin >> A >> B) {
    c = 0;
    A += B;
    keta(A);
    c++;
    cout << c << endl;
  }
  return 0;
}


#include <iostream>
#include <stdio.h>
using namespace std;
int main() {
  int a = 0, b = 0;
  int i = 0;
  while (1) {
    cin >> a >> b;
    int c = a + b;
    if (a + b < 10) {
      cout << "1" << endl;
    } else if (a + b < 100) {
      cout << "2" << endl;
    } else if (a + b < 1000) {
      cout << "3" << endl;
    } else if (a + b < 10000) {
      cout << "4" << endl;
    } else if (a + b < 100000) {
      cout << "5" << endl;
    } else if (a + b < 1000000) {
      cout << "6" << endl;
    } else {
      cout << "7" << endl;
    }
  }
  return 0;
}

#include <iostream>
#include <stdio.h>
using namespace std;
int main() {
  int a = 0, b = 0;
  int v;
  int i = 0;
  while (scanf("%d %d", &a, &b) != EOF) {
    int c = a + b;
    if (a + b < 10) {
      cout << "1" << endl;
    } else if (a + b < 100) {
      cout << "2" << endl;
    } else if (a + b < 1000) {
      cout << "3" << endl;
    } else if (a + b < 10000) {
      cout << "4" << endl;
    } else if (a + b < 100000) {
      cout << "5" << endl;
    } else if (a + b < 1000000) {
      cout << "6" << endl;
    } else {
      cout << "7" << endl;
    }
  }
  return 0;
}


#include <iostream>
using namespace std;
int main() {
  int a, b, i, ans, sum = 0;
  for (;;) {
    cin >> a >> b;
    ans = a + b;
    for (i = 0; ans > 0; i++) {
      ans = ans / 10;
      sum = sum + 1;
    }
    cout << sum << endl;
  }
  return 0;
}

#include <iostream>
using namespace std;
int main() {
  long long a, b, i, ans, sum = 0;
  while (cin >> a >> b) {
    ans = a + b;
    for (i = 0; ans > 0; i++) {
      ans = ans / 10;
      sum = sum + 1;
    }
    cout << sum << endl;
    sum = 0;
  }
  return 0;
}


#include <iostream>
using namespace std;

int main() {
  int a, b, sum;
  int count = 1;
  while (true) {
    cin >> a >> b;
    sum = a + b;

    while (sum > 1) {

      sum = sum / 10;
      count++;
    }

    cout << count << endl;
  }
  return 0;
}

#include <iostream>
using namespace std;

int main() {

  while (true) {
    int a, b, sum;
    int count = 0;

    cin >> a;

    if (cin.eof())
      break;
    cin >> b;

    sum = a + b;

    for (int i = 1; sum != 0; i++) {

      sum /= 10;
      count = i;
    }

    cout << count << endl;
  }

  return 0;
}


#include <iostream>
#include <math.h>
using namespace std;
int main() {
  while (1) {
    int a = 0, b = 0, wa = 0, keta = 0;
    cin >> a >> b;
    wa = a + b;
    keta = (int)log10(wa) + 1;
    cout << keta << endl;
  }
  return 0;
}

#include <iostream>
#include <math.h>
using namespace std;
int main() {
  int a = 0, b = 0, wa = 0, keta = 0;
  while (cin >> a >> b) {
    wa = a + b;
    keta = (int)log10(wa) + 1;
    cout << keta << endl;
  }
  return 0;
}


//
//  main.cpp
//  sanpie
//
//  Created by h3037178 on 2017/07/28.
//  Copyright ?? 2017??´ ?????£?????????. All rights reserved.
//

#include <algorithm>
#include <iostream>
using namespace std;
int main() {
  int i, o;
  for (;;) {
    cin >> i >> o;
    if (i + o < 10) {
      cout << "1" << endl;
    } else if (i + o < 100) {
      cout << "2" << endl;
    } else if (i + o < 1000) {
      cout << "3" << endl;
    } else if (i + o < 10000) {
      cout << "4" << endl;
    } else if (i + o < 100000) {
      cout << "5" << endl;
    } else if (i + o < 1000000) {
      cout << "6" << endl;
    } else {
      cout << "7" << endl;
    }
  }
}

#include <algorithm>
#include <iostream>
using namespace std;
int main() {
  int i, o, b = 0, f;
  while (cin >> i >> o) {
    f = i + o;
    for (int j = 1; j <= 1000000; j = j * 10) {
      if (f >= j) {
        b++;
      } else {
        break;
      }
    }
    cout << b << endl;
    b = 0;
  }
  return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
#define REP(i, N) for (int i = 0; i < (int)N; i++)

int main() {
  int hako[200][2];
  int i = 0;
  while (cin >> hako[i][0] >> hako[i][1]) {
    i++;
  }
  REP(j, i) {
    int a = 0;
    int sum = hako[j][0] + hako[j][1];
    while (sum > 0)
      sum / 10, a++;
    cout << a << endl;
  }
  return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
#define REP(i, N) for (int i = 0; i < (int)N; i++)

int main() {
  int a, b;
  while (cin >> a >> b) {
    int c = a + b;
    if (c == 0) {
      cout << 0 << endl;
      continue;
    }
    int count = 1;
    while (c >= 10) {
      c /= 10;
      count++;
    }
    cout << count << endl;
  }
  return 0;
}


#include <iostream>
using namespace std;
int main() {
  int a, b, c, d;
  while (cin >> a >> b) {
    c = a + b;
    d = 0;
    while (a > 0, d++, a / 10)
      ;
    cout << d << endl;
  }
  return 0;
}

#include <iostream>
using namespace std;
int main() {
  int a, b, c;
  while (cin >> a >> b) {
    int ans = 0;
    c = a + b;
    while (c > 0) {
      ans = ans + 1;
      c = c / 10;
    }
    cout << ans << endl;
  }
  return 0;
}


#include <stdio.h>

int main() {

  int l, m, n, i;

  while (1) {

    scanf("%d %d", &l, &m);
    if (l == EOF || m == EOF)
      break;
    n = l + m;

    for (i = 1; n >= 9; i++) {
      n /= 10;
    }

    printf("%d\\n", i);
  }
  return 0;
}

#include <stdio.h>

int main() {

  int l, m, n, i;

  while (1) {

    if (scanf("%d %d", &l, &m) == EOF)
      break;

    n = l + m;

    for (i = 1; n > 9; i++) {
      n /= 10;
    }

    printf("%d\\n", i);
  }
  return 0;
}


#include <iostream>
#include <math.h>
#include <string>
using namespace std;

int keta(int x) {
  int i = 0;
  while (x / pow(10, i) >= 1) {
    i++;
  }
  return i;
}
int main() {

  while (true) {
    int a1, b1;
    cin >> a1 >> b1;
    cout << keta(a1) + keta(b1) << endl;
  }
}

#include <iostream>
#include <math.h>
#include <string>
using namespace std;

int keta(int x) {
  int i = 0;
  while (x / pow(10, i) >= 1) {
    i++;
  }
  if (x == 0) {
    return 1;
  } else
    return i;
}
int main() {
  int a1, b1;
  while (cin >> a1 >> b1) {
    cout << keta(a1 + b1) << endl;
  }
  return 0;
}


#include <algorithm>
#include <functional>
#include <iostream>
using namespace std;

int main() {
  /*	int a[3];
          cin >> a[0] ;
          a[1] = 3;
          a[2] = a[0] * 10;

          cout << a[0] <<" " << a[1] <<" "<< a[2] << endl;

          for (int i = 0; i < 3; i++) {
                  cout << a[i] << endl;
          }

          sort(a,a+5);
  *//*
	int a[10];
	for (int i = 0; i < 10; i++) {
		cin >> a[i];
	}

	sort(a,a+10,greater<int>());

	for (int i = 0; i < 3; i++) {
		cout << a[i]<<endl;
	}
*/
  int ans = 0;
  int a, b, c;
  while (true) {
    ans = 0;
    cin >> a >> b;
    c = a + b;

    if (c == 0) {
      ans = 1;
    } else {
      while (c > 0) {
        c /= 10;
        ans++;
      }
    }
    cout << ans << endl;
  }
  return 0;
  ;
}

#include <algorithm>
#include <functional>
#include <iostream>
using namespace std;

int main() {
  /*	int a[3];
          cin >> a[0] ;
          a[1] = 3;
          a[2] = a[0] * 10;

          cout << a[0] <<" " << a[1] <<" "<< a[2] << endl;

          for (int i = 0; i < 3; i++) {
                  cout << a[i] << endl;
          }

          sort(a,a+5);
  *//*
	int a[10];
	for (int i = 0; i < 10; i++) {
		cin >> a[i];
	}

	sort(a,a+10,greater<int>());

	for (int i = 0; i < 3; i++) {
		cout << a[i]<<endl;
	}
*/
  int ans = 0;
  int a, b, c;
  while (cin >> a >> b) {
    ans = 0;
    c = a + b;

    if (c == 0) {
      ans = 1;
    } else {
      while (c > 0) {
        c /= 10;
        ans++;
      }
    }
    cout << ans << endl;
  }
  return 0;
  ;
}


#include <iostream>
using namespace std;
int main() {
  int a, b, c;
  do {
    cin >> a >> b;
    c = a + b;
    if (c > 1000000)
      cout << "7" << endl;
    else if (c > 100000)
      cout << "6" << endl;
    else if (c > 10000)
      cout << "5" << endl;
    else if (c > 1000)
      cout << "4" << endl;
    else if (c > 100)
      cout << "3" << endl;
    else if (c > 10)
      cout << "2" << endl;
    else
      cout << "1" << endl;
  } while (true);
}

#include <iostream>
using namespace std;
int main() {
  int a, b, c;
kuri:
  while (cin >> a >> b) {
    if (cin.eof()) {
      break;
    }
    c = a + b;
    if (c / 1000000 >= 1) {
      cout << "7" << endl;
      goto kuri;
    }
    if (c / 100000 >= 1) {
      cout << "6" << endl;
      goto kuri;
    }
    if (c / 10000 >= 1) {
      cout << "5" << endl;
      goto kuri;
    }
    if (c / 1000 >= 1) {
      cout << "4" << endl;
      goto kuri;
    }
    if (c / 100 >= 1) {
      cout << "3" << endl;
      goto kuri;
    }
    if (c / 10 >= 1) {
      cout << "2" << endl;
      goto kuri;
    } else {
      cout << "1" << endl;
      goto kuri;
    }
  }
}


#include <cmath>
#include <iostream>
using namespace std;
int main() {
  int a, b;
  for (int i = 1; i > 0;) {
    cin >> a >> b;
    cout << (int)log10(a + b) + 1 << endl;
  }
  return 0;
}

#include <cmath>
#include <iostream>
using namespace std;
int main()

{
  int a, b;
  while (cin >> a >> b) {
    cout << (int)log10(a + b) + 1 << endl;
  }
  return 0;
}


#include <iostream>
using namespace std;

int main() {
  int a, b, c, d = 0;
  cin >> a >> b;
  c = a + b;
  while (c > 0) {
    c /= 10;
    d++;
  }
  return d;
}

#include <iostream>
using namespace std;

int main() {
  int a, b, c = 0;
  while (cin >> a >> b) {
    a += b;
    c = 0;
    while (a > 0) {
      a /= 10;
      c++;
    }
    cout << c << endl;
  }
  return 0;
}


#include <math.h>
#include <stdio.h>

int main(void) {
  int a, b;
  while (scanf("%d%d", &a, &b)) {
    int c = a + b;
    int d = (int)log10(c);
    printf("%d\\n", d);
  }
  return 0;
}

#include <math.h>
#include <stdio.h>

int main(void) {
  int a, b;
  while (scanf("%d%d", &a, &b) != EOF) {
    int c = a + b;
    int d = (int)log10(c) + 1;
    printf("%d\\n", d);
  }
  return 0;
}


#include <iostream>
#include <string>
using namespace std;
int main() {
  int a, b;
  int c1 = 1;
  while (1) {
    cin >> a >> b;
    a += b;
    while (1) {
      if (a / 10 > 0) {
        ++c1;
        a = a / 10;
      } else
        break;
    }
    cout << c1 << endl;
    c1 = 1;
  }
  return 0;
}

#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <string>
using std::cin;
using std::cout;
using std::endl;
using std::sort;
using std::string;
#define rep(X, Y) for (int(X) = 0; (X) < (Y); ++(X))
#define rept(X, Y, Z) for (int(X) = (Y); (X) < (Z); ++(X))
#define repr(X, Y) for (int(X) = (Y); (X) >= 0; --(X))
const double pi = 3.141592653589793283462;
int main() {
  int a, b, c;
  while (cin >> a >> b) {
    int co = 1;
    c = a + b;
    while (1) {
      if (c / 10 >= 1) {
        co += 1;
        c /= 10;
      } else
        break;
    }
    cout << co << endl;
    co = 1;
  }
  return 0;
}


#include <algorithm>
#include <iostream>
using namespace std;
int main() {
  int a, b;
  while (cin >> a >> b) {
    int t = 8700;
    for (int i = t; i; i--) {
      for (int j = i; j; j--) {
        if (i + j == 2)
          a += b;
      }
    }
    int cnt = 0;
    while (a)
      a /= 10, cnt++;
    cout << cnt << endl;
  }
  return 0;
}

#include <algorithm>
#include <iostream>
using namespace std;
int main() {
  int a, b;
  while (cin >> a >> b) {
    int t = 8650;
    for (int i = t; i; i--) {
      for (int j = i; j; j--) {
        if (i + j == 2)
          a += b;
      }
    }
    int cnt = 0;
    while (a)
      a /= 10, cnt++;
    cout << cnt << endl;
  }
  return 0;
}


#include <stdio.h>

int main(void) {
  int a[200], b[200], sum[200], keta[200], cnt = 0, set = 0;

  scanf("%d", &set);
  for (int i = 0; i < set; i++) // input
    scanf("%d%d", &a[i], &b[i]);

  for (int i = 0; i < set; i++) {
    sum[i] = a[i] + b[i];
    while (sum[i] != 0) {
      sum[i] = sum[i] / 10;
      cnt++;
    }
    printf("%d\\n", cnt);
    cnt = 0;
  }

  return 0;
}

#include <iostream>
using namespace std;

int main() {
  int a[200], b[200], sum[200], keta[200], cnt = 0, set = 0;

  while (cin >> a[set] >> b[set]) {
    set++;
  }

  for (int i = 0; i < set; i++) {
    sum[i] = a[i] + b[i];
    while (sum[i] != 0) {
      sum[i] = sum[i] / 10;
      cnt++;
    }
    cout << cnt << endl;
    cnt = 0;
  }

  return 0;
}


#include <iostream>
using namespace std;
int main() {
  long int a, b;
  int x[200];
  int n = 0;
  while (cin >> a >> b) {
    x[n] = 0;
    a = a + b;
    while (1) {
      a = a / 10;
      if (a >= 10)
        x[n]++;
    }
    n++;
  }

  for (int i = 0; i < n; i++)
    cout << x[i] << '\\n';

  return 0;
}

#include <iostream>
using namespace std;
int main() {
  long int a, b;
  int x[200];
  int n = 0;
  while (cin >> a >> b) {
    x[n] = 1;
    a = a + b;
    while (1) {
      a = a / 10;
      if (a >= 1)
        x[n]++;
      else
        break;
    }
    n++;
  }

  for (int i = 0; i < n; i++)
    cout << x[i] << '\\n';

  return 0;
}


#include <array>
#include <iostream>

int main() {
  int a;
  int b;
  int sum;
  int digit;
  bool flag = true;
  while (flag) {
    std::cin >> a >> b;
    if (a == 0 && b == 0) {
      flag = false;
      break;
    } else {
      sum = a + b;
      digit = 0;
      while (sum != 0) {
        sum = sum / 10;
        digit++;
      }
      std::cout << digit << std::endl;
    }
  }
  return 0;
}

#include <array>
#include <iostream>

int main() {
  int a;
  int b;
  int sum;
  int digit;
  while (std::cin >> a >> b) {
    sum = a + b;
    digit = 0;
    while (sum != 0) {
      sum = sum / 10;
      digit++;
    }
    std::cout << digit << std::endl;
  }
  return 0;
}


#include <iostream>
using namespace std;

int main() {
  int a, b, c, i;
  while (true) {
    cin >> a >> b;
    if (a == 0 && b == 0)
      break;
    c = a + b;
    for (i = 1; true; i++) {
      c = c / 10;
      if (c == 0)
        break;
    }
    cout << i << "\\n";
  }

  return 0;
}

#include <iostream>
using namespace std;

int main() {
  int a, b, c, i;
  for (int j = 0; j < 200; j++) {
    if (!(cin >> a >> b))
      break;
    c = a + b;
    for (i = 1; true; i++) {
      c = c / 10;
      if (c == 0)
        break;
    }
    cout << i << endl;
  }

  return 0;
}


#include <iostream>
using namespace std;

int main() {
  int a, b, k;
  cin >> a;
  while (a != ' ') {
    cin >> b;
    b += a;
    k = 0;
    while (b >= 1) {
      b /= 10;
      k += 1;
    }
    cout << k << endl;
    cin >> a;
  }
  return 0;
}

#include <iostream>
using namespace std;

int main() {
  int a, b, ans;
  while (true) {
    cin >> a;
    if (cin.eof()) {
      break;
    }
    cin >> b;
    int sum = a + b;
    ans = 0;
    while (sum >= 1) {
      sum /= 10;
      ans += 1;
    }
    cout << ans << endl;
  }
  return 0;
}


#include <iostream>

int main() {
  int a, b, c;
  int i = 1;
  int num = 0;

  std::cin >> a;
  std::cin >> b;

  c = a + b;
  while (1) {
    if (c / i != 0) {
      num++;
    } else {
      break;
    }
  }
  std::cout << num << std::endl;

  return 0;
}

#include <iostream>
#include <stdio.h>

int main() {
  int a, b, c;
  int i;
  int num;

  while (scanf("%d", &a) != EOF) {
    scanf("%d", &b);

    i = 10;
    num = 1;
    c = a + b;
    while (1) {
      if (c / i != 0) {
        num++;
        i *= 10;
      } else {
        break;
      }
    }
    std::cout << num << std::endl;
  }

  return 0;
}


#include <iostream>
#include <math.h>
#include <stdio.h>
#include <string.h>
using namespace std;

#define MAX 256

int main(void) {

  int a, b, c[MAX], t = 0;
  int i = 0, s;

  while (t == 0) {
    c[i] = 0;
    scanf("%d%d", &a, &b);
    s = a + b;
    while (s >= 10) {
      c[i]++;
      s = s / 10;
    }
    i++;
  }

  for (int j = 0; j < i; j++) {
    printf("%d", c[j]);
  }

  return 0;
}

#include <iostream>
#include <math.h>
#include <stdio.h>
#include <string.h>
using namespace std;

#define MAX 256

int f(int z) {
  if (z < 10)
    return 1;
  return 1 + f(z / 10);
}

int main(void) {

  int ans[200];
  for (long i = 0; i < 200; i++) {
    ans[i] = 0;
  }

  long a, b;
  long i = 0;

  while (scanf("%ld%ld", &a, &b) != EOF) {
    ans[i] = f(a + b);
    i++;
  }

  for (int j = 0; j < i; j++) {
    printf("%d\\n", ans[j]);
  }

  return 0;
}


#include <iostream>

int main() {
  while (1) {
    int a;
    int b;
    std::cin >> a;
    std::cin >> b;

    int c = a + b;
    int digit = 1;
    bool loop = true;
    while (loop) {
      if (c / 10 >= 1) {
        digit += 1;
        c = (c - (c % 10)) / 10;
      } else {
        loop = false;
        break;
      }
    }
    std::cout << digit << std::endl;
  }
}

#include <iostream>

int main() {
  while (1) {
    double a, b;

    std::cin >> a;
    std::cin >> b;

    if (std::cin.eof()) {
      break;
    }

    double c = a + b;
    int ans = 1;
    bool flag = false;

    while (!flag) {
      if (c / 10 >= 1) {
        c /= 10;
        ans += 1;
      } else {
        flag = true;
      }
    }

    std::cout << ans << std::endl;
  }

  return 0;
}


#include "bits/stdc++.h"
using namespace std;

int main() {
  while (1) {
    int a, b;
    cin >> a >> b;
    int n = a + b;
    int ans = 0;
    while (n > 0) {
      n /= 10;
      ans++;
    }
    if (ans == 0)
      ans++;
    cout << ans << endl;
  }
  return 0;
}

#include "bits/stdc++.h"
using namespace std;

int main() {
  int a, b;
  while (cin >> a >> b) {
    int n = a + b;
    int ans = 0;
    while (n > 0) {
      n /= 10;
      ans++;
    }
    if (ans == 0)
      ans++;
    cout << ans << endl;
  }
  return 0;
}


#include "stdio.h"

int main() {
  int a = 0, b = 0, c = 0, count = 0;
  while (1) {
    scanf("%d %d", &a, &b);
    c = a + b;
    while (c > 0) {
      c = c / 10;
      count++;
    }
    printf("%d\\n", count);
    count = 0;
  }
}

#include <iostream>
using namespace std;

int main() {
  int a, b;

  while (cin >> a >> b) {
    a += b;
    int t = 1, cnt = 0;
    while (1) {
      if (a < t) {
        break;
      } else {
        t *= 10;
        ++cnt;
      }
    }
    cout << cnt << endl;
  }
}


#include <algorithm>
#include <bitset>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

typedef long long ll;

using namespace std;

int main(void) {
  int a, b;
  while (1) {
    cin >> a &&cin >> b;
    if (a == EOF)
      break;

    if (a == 0 && b == 0) {
      cout << "1" << endl;
      continue;
    }

    int count = 0;
    int c = a + b;
    while (c != 0) {
      c /= 10;
      count++;
    }

    cout << count << endl;
  }

  return 0;
}

#include <algorithm>
#include <bitset>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

typedef long long ll;

using namespace std;

int main(void) {
  int a, b;
  while (1) {
    if (cin >> a == 0)
      break;
    cin >> b;

    if (a == 0 && b == 0) {
      cout << "1" << endl;
      continue;
    }

    int count = 0;
    int c = a + b;
    while (c != 0) {
      c /= 10;
      count++;
    }

    cout << count << endl;
  }

  return 0;
}


#include <bits/stdc++.h>

using namespace std;

int digit(int a) {
  int cnt = 0;

  while (a) {
    a /= 10;
    cnt++;
  }
  return cnt;
}
int main() {
  int a, b;

  while (1) {
    int n = 0;
    cin >> a >> b;

    n = digit(a + b);

    cout << n << endl;
  }
  return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main() {
  int a, b;

  while (scanf("%d%d", &a, &b) != EOF) {
    int cnt = 0;
    int sum = a + b;

    while (1) {
      sum /= 10;
      cnt++;
      if (!sum)
        break;
    }
    cout << cnt << endl;
  }
  return 0;
}


#include <bits/stdc++.h>
#include <cstdio>
using namespace std;

int a;
int b;

int main() {
  while (cin >> a >> b, a != EOF) {
    int i;
    a = a + b;
    while (a > 0) {
      a = a / 10;
      ++i;
    }

    cout << i << endl;
  }
}

#include <bits/stdc++.h>
using namespace std;

int a, b;

int main() {
  while (scanf("%d %d", &a, &b) != EOF) {
    int i = 0;
    a = a + b;
    while (a > 0) {
      a = a / 10;
      ++i;
    }

    cout << i << endl;
  }
}


#include <algorithm>
#include <iostream>
using namespace std;

int main() {
  while (true) {
    int a, b;
    cin >> a >> b;
    int sum = a + b;
    int i = 1;
    int count = 0;
    while (sum / i != 0) {
      count++;
      i *= 10;
    }
    cout << count;
  }
  return 0;
}

#include <algorithm>
#include <iostream>
using namespace std;

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


#define scanf_s scanf
#include <iostream>
#include <stdio.h>
using namespace std;
#define MAX 200
int main(void) {
  int a, b, i, sum, cou = 0;
  int ans[MAX] = {0};
  while (scanf_s("%d %d", &a, &b) != 0) {
    sum = a + b;
    ++ans[cou];
    if (sum != 0) {
      while (1) {
        if (sum <= 1)
          break;
        sum /= 10;
        ++ans[cou];
      }
    }
    ++cou;
  }
  for (i = 0; i < cou; ++i) {
    if (i != 0)
      printf("\\n");
    printf("%d", ans[i]);
  }
}

#define scanf_s scanf
#include <iostream>
#include <stdio.h>
using namespace std;
#define MAX 200
int main(void) {
  int a, b, sum, cou = 0;
  while (scanf_s("%d %d", &a, &b) != EOF) {
    sum = a + b;
    while (1) {
      if (sum <= 0)
        break;
      sum /= 10;
      ++cou;
    }
    printf("%d\\n", cou);
    cou = 0;
  }
}


#include <cstdio>
char s[9];
int main() {
  for (int a, b; ~scanf("%d %d", a, b); printf("%d\\n", sprintf(s, "%s", a + b)))
    ;
}

#include <cstdio>
char d[9];
int main() {
  for (int a, b; ~scanf("%d %d", &a, &b);
       printf("%d\\n", sprintf(d, "%d", a + b)))
    ;
}


#include <fstream>
#include <iostream>
using namespace std;

int main(int argc, char *argv[]) {
  ifstream fin(argv[1]);
  int a, b;
  int count;
  int wa;
  while (!fin.eof()) {
    fin >> a >> b;
    count = 1;
    wa = a + b;
    while (wa / 10 != 0) {
      count++;
      wa /= 10;
    }
    cout << count << endl;
  }
  return 0;
}

#include <iostream>
using namespace std;

int main() {
  int a, b;
  int count;
  int wa;
  while (cin >> a && cin >> b) {
    count = 1;
    wa = a + b;
    while ((wa /= 10) != 0) {
      count++;
    }
    cout << count << endl;
  }
  return 0;
}


#include <iostream>
using namespace std;

int main() {
  int a, b, c;
  while (1) {
    int k = 1;
    cin >> a >> b;
    c = a + b;
    while (c / 10 > 0) {
      c /= 10;
      k++;
    }
    cout << k << endl;
  }
  return 0;
}

#include <iostream>
using namespace std;

int main() {
  int a, b, c, k;
  string str;
  while (1) {
    k = 1;
    getline(cin, str);
    if (str.size() == 0) {
      break;
    }
    sscanf(str.c_str(), "%d %d", &a, &b);
    c = a + b;
    while (c / 10 > 0) {
      c /= 10;
      k++;
    }
    printf("%d\\n", k);
  }
  return 0;
}


#include <cstdio>
#include <iostream>

using namespace std;

int digit(int num) {
  if ((num / 10) > 0) {
    return (digit(num / 10)) + 1;
  } else
    return 1;
}

int main() {
  int num1, num2, result = 0;
  char buf[64];
  while (1) {
    fgets(buf, 64, stdin);
    if (buf[0] == '\\0')
      break;
    num1 = 0;
    num2 = 0;
    sprintf(buf, "%d %d", num1, num2);
    result += digit(num1);
    result += digit(num2);
    cout << result << endl;
  }
  return 0;
}

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
using namespace std;

int digit(int num) {
  if ((num / 10) > 0)
    return (digit(num / 10)) + 1;
  else
    return 1;
}

int main() {
  int num1, num2, result = 0;
  char buf[32];
  while (fscanf(stdin, "%d %d", &num1, &num2) != EOF) {
    result = digit(num1 + num2);
    cout << result << endl;
  }
  return 0;
}


#include <stdio.h>

int main(void) {
  int a, b;
  int sum;
  int loop_i, loop_j;
  int cnt = 0;

  while (1) {
    sum = 0;
    fscanf(stdin, "%d %d", &a, &b);
    sum = a + b;
    do {
      sum = sum / 10;
      cnt++;
      if (sum == 0)
        break;
    } while (1);
    printf("%d\\n", cnt);
  }
  return 0;
}

#include <stdio.h>

int main(void) {
  int a, b;
  int sum;
  int loop_i, loop_j;
  int cnt = 0;

  while (scanf("%d %d", &a, &b) != EOF) {
    sum = 0;
    sum = a + b;
    for (loop_i = 0; sum != 0; loop_i++)
      sum /= 10;
    printf("%d\\n", loop_i);
  }
  return 0;
}


#include <iostream>
#include <math.h>

using namespace std;

int main(void) {
  int a, b;

  while (true) {
    cin >> a;
    cin >> b;

    cout << (int)log10(a + b) + 1 << endl;
  }

  return 0;
}

#include <iostream>
#include <math.h>

using namespace std;

int main(void) {
  long a, b;

  while (cin >> a) {
    cin >> b;

    cout << (int)log10(a + b) + 1 << endl;
  }

  return 0;
}


#include <stdio.h>
int main() {
  while (true) {
    int a, b;
    scanf("%d %d", &a, &b);
    if (a == EOF || b == EOF)
      break;

    int temp = a + b;
    int ans = 1;
    while ((temp /= 10) >= 10) {
      ans++;
    }
    printf("%d\\n", ans);
  }
}

#include <stdio.h>
int main() {
  int a;
  while (scanf("%d", &a) != EOF) {
    int b;
    scanf("%d", &b);

    int temp = a + b;
    int ans = 1;
    while ((temp /= 10) > 0) {
      ans++;
    }
    printf("%d\\n", ans);
  }
}


#include <stdio.h>
int main(void) {
  int i, a, x, b, c;
  x = 0;
  c = 1;
  b = 1;
  while (scanf("%d%d", &a, &b) != EOF) {
    x = a + b;
    while (1) {
      if (x / b != 0) {
        c++;
        b *= 10;
      } else
        break;
    }
    printf("%d\\n", c);
  }
}

#include <stdio.h>
int main(void) {
  int i, a, x, b, c;
  while ((scanf("%d%d", &a, &b)) != EOF) {
    c = 0;
    x = a + b;
    while (x != 0) {
      x = x / 10;
      c++;
    }
    printf("%d\\n", c);
  }
}


#include <iostream>
int main() {
  int a, b;
  while (std::cin >> a >> b) {
    int n = a + b;
    if (n < 10)
      std::cout << 1 << std::endl;
    else if (n < 100)
      std::cout << 2 << std::endl;
    else if (n < 1000)
      std::cout << 3 << std::endl;
    else if (n < 10000)
      std::cout << 4 << std::endl;
    else if (n < 100000)
      std::cout << 5 << std::endl;
    else if (n < 1000000)
      std::cout << 6 << std::endl;
    else if (n < 10000000)
      std::cout << 7 << std::endl;
    else if (n < 100000000)
      std::cout << 8 << std::endl;
  }
  return 0;
}


#include <iostream>
#include <string>
using namespace std;
int main() {
  string a;
  while (1) {
    cin >> a;
    if (a.length() < 20)
      break;
  }
  for (int i = a.length() - 1; i > -1; i--) {
    cout << a[i];
  }
  return 0;
}

#include <iostream>
#include <string>
using namespace std;
int main() {
  string a;
  cin >> a;

  for (int i = a.length() - 1; i > -1; i--) {
    cout << a[i];
  }
  cout << "\\n";
  return 0;
}


#include <algorithm>
#include <cmath>
#include <cstdint>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <utility>
#include <vector>
using namespace std;

constexpr int INF = 1000000000; /* 1e+9a */
constexpr int MODULO = 1000000007;

#define int long

#define REP(i, f, n) for (int i = (f); i < (n); ++i)
#define PER(i, f, n) for (int i = (n - 1); i >= f; --i)

constexpr int evx[4] = {1, 0, -1, 0};
constexpr int evy[4] = {0, 1, 0, -1};

//----------------------------------
//----------------------------------

signed main() {
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  PER(i, s.size(), 0)
  cout << s[i];
  cout << endl;
}

#include <algorithm>
#include <cmath>
#include <cstdint>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <utility>
#include <vector>
using namespace std;

constexpr int INF = 1000000000; /* 1e+9a */
constexpr int MODULO = 1000000007;

#define int long

#define REP(i, f, n) for (int i = (f); i < (n); ++i)
#define PER(i, f, n) for (int i = (n - 1); i >= f; --i)

constexpr int evx[4] = {1, 0, -1, 0};
constexpr int evy[4] = {0, 1, 0, -1};

//----------------------------------
//----------------------------------

signed main() {
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  PER(i, 0, s.size())
  cout << s[i];
  cout << endl;
}


#include <iostream>
using namespace std;

int main() {
  char x[30];
  int i = 0;
  scanf("%s\\n", &x);
  while (x[i] != '\\0')
    i++;
  for (int j = i - 1; j > -1; j++)
    cout << x[i];
}

#include <iostream>
#include <string>
using namespace std;

int main() {
  string s, ans = "";
  int sl;
  cin >> s;
  sl = s.size();
  for (int i = sl - 1; i > -1; i--)
    ans += s[i];
  cout << ans << endl;
}


#include <stdio.h>
int main() {
  char str[20];
  int i, j;
  scanf("%s", str);

  for (i = 0; str[i] != '\\0'; i++) {
  }

  for (j = i - 1; j > -1; j--) {
    printf("%c", str[j]);
  }

  puts("");

  return 0;
}

#include <stdio.h>
int main() {
  char str[21];
  int i, j;
  scanf("%s", str);

  for (i = 0; str[i] != '\\0'; i++) {
  }

  for (j = i - 1; j > -1; j--) {
    printf("%c", str[j]);
  }

  puts("");

  return 0;
}


#include <stdio.h>
#include <string.h>
int main(void) {

  int i, j, n;
  i = 0;
  j = 0;
  char a[20], b[20];

  scanf("%s", a);

  n = strlen(a);

  for (i = n - 1; i >= 0; i--) {
    b[n - 1 - i] = a[i];
    printf("%c\\n", b[n - 1 - i]);
  }
  b[n] = '\\0';

  printf("%s\\n", b);
  return 0;
}

#include <algorithm>
#include <iostream>
#include <string>

using namespace std;

int main(void) {
  string str;
  cin >> str;
  reverse(str.begin(), str.end());
  cout << str << endl;
  return 0;
}


#include <iostream>
#include <string>

using namespace std;

int main() {
  string str;
  cin >> str;

  for (int i = str.size() - 1; i >= 0; i++) {
    cout << str[i];
  }
  cout << endl;
  return 0;
}

#include <iostream>
#include <string>

using namespace std;

int main() {
  string str;
  cin >> str;

  for (int i = str.size() - 1; i >= 0; i--) {
    cout << str[i];
  }
  cout << endl;
  return 0;
}


#include <iostream>
#include <string>

using namespace std;

int main() {
  string str;
  string ans;
  while (1) {
    cin >> str;
    ans = str;
    for (int i = 0; i < str.size(); i++) {
      ans[i] = str[str.size() - i - 1];
    }
    cout << ans << endl;
  }
}

#include <iostream>
#include <string>

using namespace std;

int main() {
  string str;
  string ans;
  cin >> str;
  ans = str;
  for (int i = 0; i < str.size(); i++) {
    ans[i] = str[str.size() - i - 1];
  }
  cout << ans << endl;
}


#include <iostream>
#include <string>
using namespace std;
string s;
int main() {
  cin >> s;
  for (unsigned i = s.size() - 1; i >= 0; i--)
    cout << s[i];
  return 0;
}

#include <iostream>
#include <string>
using namespace std;
string s;
int main() {
  cin >> s;
  for (string::reverse_iterator it = s.rbegin(); it != s.rend(); it++)
    cout << *it;
  cout << endl;
  return 0;
}


#include <iostream>
#include <string>

using namespace std;

int main() {
  string S;

  cin >> S;

  for (string::size_type i = S.size() - 1; i >= 0; i--) {
    cout << S[i];
  }

  cout << endl;

  return 0;
}

#include <algorithm>
#include <iostream>
#include <string>
#include <utility>

using namespace std;

int main() {
  string S;

  cin >> S;

  for (string::size_type i = 0; i < S.size() / 2; i++) {
    swap(S[i], S[S.size() - i - 1]);
  }

  for (string::size_type i = 0; i < S.size(); i++) {
    cout << S[i];
  }

  cout << endl;

  return 0;
}


#include <stdio.h>
#include <string.h>

int main(void) {
  char str[20];
  scanf("%s", str);
  for (int i = strlen(str) - 1; i > 0; i--)
    printf("%s", str[i - 1]);
  printf("\\n");
  return 0;
}

#include <stdio.h>
#include <string.h>

int main(void) {
  char str[20];
  scanf("%s", str);
  for (int i = strlen(str) - 1; i >= 0; i--) {
    printf("%c", str[i]);
  }
  printf("\\n");
  return 0;
}


#include <cstring>
#include <iostream>

using namespace std;

int main() {
  char stra[20], strb[20];
  int a, c;
  cin >> stra;
  a = strlen(stra);
  for (int i = 0; i < a; i++) {
    c = a - i - 1;
    strb[i] = stra[c];
    strb[i + 1] = '\\0';
  }
  cout << strb << endl;
}

#include <cstring>
#include <iostream>
using namespace std;
int main() {
  char stra[21], strb[21];
  int a, c;
  cin >> stra;
  a = strlen(stra);
  for (int i = 0; i < a; i++) {
    c = a - i - 1;
    strb[i] = stra[c];
    strb[i + 1] = '\\0';
  }
  cout << strb << endl;
}


#include <algorithm>
#include <cstdio>
using namespace std;

int main(int argc, char *argv[]) {
  char rcv[20];
  char out[20];
  fscanf(stdin, "%s\\n", rcv);
  int cnt = 0;
  for (int i = 0; i < 20; i++) {
    if (rcv[i] == '\\0') {
      for (int j = i - 1; j != -1; j--) {
        out[cnt] = rcv[j];
        cnt++;
      }
      out[cnt] = '\\0';
      break;
    }
  }
  printf("%s\\n", out);

  return 0;
}

#include <algorithm>
#include <cstdio>
using namespace std;

int main(int argc, char *argv[]) {
  char rcv[21];
  char out[21];
  fscanf(stdin, "%s\\n", rcv);
  int cnt = 0;
  for (int i = 0; i < 21; i++) {
    if (rcv[i] == '\\0') {
      for (int j = i - 1; j != -1; j--) {
        out[cnt] = rcv[j];
        cnt++;
      }
      out[cnt] = '\\0';
      break;
    }
  }
  printf("%s\\n", out);

  return 0;
}


#include <iostream>
#include <string>
using namespace std;
int main() {
  char a;
  string str;
  cin >> str;
  for (int i = 0; i != str.size() - 1 - i; i++) {
    a = str[i];
    str[i] = str[str.size() - 1 - i];
    str[str.size() - 1 - i] = a;
  }
  cout << str << endl;
}

#include <iostream>
#include <string>
using namespace std;
int main() {
  char a;
  string str;
  cin >> str;
  for (int i = 0; i < str.size() - 1 - i; i++) {
    a = str[i];
    str[i] = str[str.size() - 1 - i];
    str[str.size() - 1 - i] = a;
  }
  cout << str << endl;
}


#include <algorithm>
#include <bitset>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <iterator>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <time.h>
#include <vector>
using namespace std;
#define FOR(I, F, N) for (int I = F; I < (int)(N); I++)
#define rep(i, n) FOR(i, 0, n)
#define FIN(V) cout << V << endl
#define pb push_back
#define INF (1 << 30)
typedef pair<int, int> P;
typedef long long ll;
typedef priority_queue<int> pq;
int StrToInt(string);
string IntToStr(int);
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, 1, -1};

int main(void) {
  string S;
  cin >> S;
  for (int i = S.size();; i--)
    cout << S[i];
  cout << endl;

  return 0;
}

int StrToInt(string s) {
  stringstream ss;
  ss << s;
  int val;
  ss >> val;
  return val;
}
string IntToStr(int i) {
  stringstream ss;
  ss << i;
  return ss.str();
}

#include <algorithm>
#include <bitset>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <iterator>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <time.h>
#include <vector>
using namespace std;
#define FOR(I, F, N) for (int I = F; I < (int)(N); I++)
#define rep(i, n) FOR(i, 0, n)
#define FIN(V) cout << V << endl
#define pb push_back
#define INF (1 << 30)
typedef pair<int, int> P;
typedef long long ll;
typedef priority_queue<int> pq;
int StrToInt(string);
string IntToStr(int);
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, 1, -1};

int main(void) {
  string S;
  cin >> S;
  for (int i = S.size(); i--;)
    cout << S[i];
  cout << endl;

  return 0;
}

int StrToInt(string s) {
  stringstream ss;
  ss << s;
  int val;
  ss >> val;
  return val;
}
string IntToStr(int i) {
  stringstream ss;
  ss << i;
  return ss.str();
}


#include <iostream>
#include <string>

using namespace std;

int main() {
  string str;
  cin >> str;
  int i = 0, j = str.size() - 1;
  while (i < j) {
    char tmp;
    tmp = str[i];
    str[i] = str[j];
    str[j] = tmp;
  }
  cout << str << endl;
  return 0;
}

#include <iostream>
#include <string>

using namespace std;

int main() {
  string str;
  cin >> str;
  int i = 0, j = str.size() - 1;
  while (i < j) {
    char tmp;
    tmp = str[i];
    str[i] = str[j];
    str[j] = tmp;
    ++i;
    --j;
  }
  cout << str << endl;
  return 0;
}


#include <iostream>
#include <string>
using namespace std;
int main() {
  string s;
  cin >> s;
  if (s.size() <= 20) {
    for (int i = s.size();; i--) {
      cout << s[i];
    }
    cout << endl;
  }
  return 0;
}

#include <iostream>
#include <string>
using namespace std;
int main() {
  string s;
  cin >> s;
  if (s.size() <= 20) {
    for (int i = s.size(); i--;) {
      cout << s[i];
    }
    cout << endl;
  }
  return 0;
}


#include <stdio.h>
#include <string.h>

int main(void) {
  char str[20], reversed_str[20];
  scanf("%s", str);
  int len = strlen(str);

  int i;
  for (i = 0; i < len; ++i) {
    reversed_str[i] = str[len - 1 - i];
  }
  reversed_str[len] = '\\0';

  printf("%s\\n", reversed_str);

  return 0;
}

#include <stdio.h>
#include <string.h>

int main(void) {
  char str[21], reversed_str[21];
  scanf("%s", str);
  int len = strlen(str);

  int i;
  for (i = 0; i < len; ++i) {
    reversed_str[i] = str[len - 1 - i];
  }
  reversed_str[len] = '\\0';

  printf("%s\\n", reversed_str);

  return 0;
}


#include <iostream>
using namespace std;
int main() {
  string str;
  cin >> str;
  int n = str.size();
  for (int i = n - 1; i >= 0; i++) {
    cout << str[i];
  }
  cout << endl;
}

#include <iostream>
using namespace std;
int main() {
  string str;
  cin >> str;
  int n = str.size();
  for (int i = n - 1; i >= 0; i--) {
    cout << str[i];
  }
  cout << endl;
}


#include <cstdio>
#include <cstring>
#include <iostream>

using namespace std;

void sort(char *str) {
  int len, len2 = 0;
  char work;
  len = strlen(str);

  for (len = len - 1; len > len2; len--, len2++) {
    work = str[len];
    str[len] = str[len2];
    str[len2] = work;
  }
}

int main() {
  char str[20];
  cin >> str;
  sort(str);
  cout << str << endl;
  return 0;
}

#include <cstdio>
#include <cstring>
#include <iostream>

using namespace std;
void sort(char *str) {
  int len, len2 = 0;
  char work;
  len = strlen(str);

  for (len = len - 1; len > len2; len--, len2++) {
    work = str[len];
    str[len] = str[len2];
    str[len2] = work;
  }
}

int main() {
  char str[21];

  cin >> str;
  sort(str);
  cout << str << endl;
  return 0;
}


#include <iostream>
#include <string>
using namespace std;

int main() {
  string str;
  cin >> str;
  for (size_t i = str.size() - 1; i >= 0; --i) {
    cout << str[i];
  }
  cout << endl;
  return 0;
}

#include <iostream>
#include <string>
using namespace std;

int main() {
  string str;
  cin >> str;
  for (size_t i = str.size() - 1; i >= 0; --i) {
    if (i == -1)
      break;
    cout << str[i];
  }
  cout << endl;
  return 0;
}


#include <cstdio>
#include <stack>

using namespace std;

int main() {
  char str[22];
  stack<char> stk;

  fgets(str, sizeof(str) - 1, stdin);

  for (int i = 0; str[i] != '\\n'; i++) {
    stk.push(str[i]);
  }

  while (!stk.empty()) {
    putchar(stk.top());
    stk.pop();
  }

  return 0;
}

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

using namespace std;

int gcd(int, int);

int main() {
  char str[21];

  scanf("%s", str);
  for (int i = strlen(str) - 1; 0 <= i; i--) {
    putchar(str[i]);
  }
  putchar('\\n');

  return 0;
}


#include <algorithm>
#include <iostream>
#include <math.h>
#include <string.h>
using namespace std;
int main() {
  string x;
  int i;
  cin >> x;
  for (i = x.size();; i--) {
    cout << x[i];
  }
  cout << endl;
  return 0;
}

#include <algorithm>
#include <iostream>
#include <math.h>
#include <string.h>
using namespace std;
int main() {
  string x;
  int i;
  cin >> x;
  for (i = x.size(); i--;) {
    cout << x[i];
  }
  cout << endl;
  return 0;
}


#include <iostream>
using namespace std;

int main(void) {
  string str;
  cin >> str;
  int l = str.size();
  for (int i = l; i >= 0; i++) {
    cout << str[i];
  }
  cout << endl;
  return 0;
}

#include <iostream>
using namespace std;

int main(void) {
  string str;
  cin >> str;
  int l = str.size();
  for (int i = l; i > 0; i--) {
    cout << str[i - 1];
  }
  cout << endl;
  return 0;
}


#include <cstdio>
#include <cstring>
using namespace std;
int main() {
  char str[20];
  scanf("%s", str);
  int len = strlen(str);
  for (int i = len - 1; i >= 0; i--) {
    printf("%c", str[i]);
  }
  printf("\\n");
  return 0;
}

#include <cstdio>
#include <cstring>
using namespace std;
int main() {
  char str[21];
  scanf("%s", str);
  int len = strlen(str);
  for (int i = len - 1; i >= 0; i--) {
    printf("%c", str[i]);
  }
  printf("\\n");
  return 0;
}


#include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;

int main() {
  char str[100];
  int len;
  while (scanf("%s", str)) {
    len = strlen(str);
    reverse(str, str + len);
    printf("%s\\n", str);
  }
  return 0;
}


#include <iostream>
#include <math.h>
#include <string>
#include <vector>

int main(void);
std::string rev_string(std::string str);

int main() {
  std::string str = "";
  // char str[20];
  std::cin >> str;
  std::cout << rev_string(str) << std::endl;

  while (1)
    ;
  return 0;
}

//*
std::string rev_string(std::string str) {
  int i;
  int len = str.length();
  for (i = 0; i < len / 2; i++) {
    char temp = str[i];
    str[i] = str[len - i - 1];
    str[len - i - 1] = temp;
  }

  return str;
}
//*/

#include <iostream>
#include <math.h>
#include <string>
#include <vector>

int main(void);
std::string rev_string(std::string str);

int main() {
  std::string str = "";
  // char str[20];
  std::cin >> str;
  std::cout << rev_string(str) << std::endl;

  // while (1);
  return 0;
}

//*
std::string rev_string(std::string str) {
  int i;
  int len = str.length();
  for (i = 0; i < len / 2; i++) {
    char temp = str[i];
    str[i] = str[len - i - 1];
    str[len - i - 1] = temp;
  }

  return str;
}
//*/


#include <cstring>
#include <iostream>
using namespace std;
int main() {
  char in[20], out[20];
  cin >> in;
  int len = strlen(in);
  for (int i = 0; i < len; i++) {
    out[len - i - 1] = in[i];
  }
  out[len] = 0;
  cout << out << endl;
  return 0;
}

#include <cstring>
#include <iostream>
using namespace std;
int main() {
  char in[21], out[21];
  cin >> in;
  int len = strlen(in);
  for (int i = 0; i < len; i++) {
    out[len - i - 1] = in[i];
  }
  out[len] = 0;
  cout << out << endl;
  return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {

  string s;

  cin >> s;

  for (int i = s.size() - 1; i >= 0; ++i)
    cout << s[i];

  cout << endl;
}

#include <bits/stdc++.h>
using namespace std;

int main() {

  string s;

  cin >> s;

  for (int i = s.size() - 1; i >= 0; --i)
    cout << s[i];

  cout << endl;
}


#include <iostream>
#include <string>

using namespace std;

int main() {
  string str;
  cin >> str;
  for (int i = str.size() - 1; i >= 0; i++)
    cout << str[i];
  cout << endl;
  return 0;
}

#include <iostream>
#include <string>

using namespace std;

int main() {
  string str;
  cin >> str;
  for (int i = str.size() - 1; i >= 0; i--)
    cout << str[i];
  cout << endl;
  return 0;
}


#include <stdio.h>
#include <string.h>
int main() {
  char a[20];
  scanf("%s", &a);
  for (int i = strlen(a) - 1; i >= 0; i--) {
    printf("%c", a[i]);
  }
  return 0;
}

#include <stdio.h>
#include <string.h>
int main() {
  char a[100];
  scanf("%s", &a);
  for (int i = strlen(a) - 1; i >= 0; i--) {
    printf("%c", a[i]);
  }
  printf("\\n");
  return 0;
}


#include <cmath>
#include <cstdio>
#include <iostream>
#include <vector>

using namespace std;

int comp(int a, int b) {
  int buffer;
  if (a > b) {
    b = buffer;
    b = a;
    a = buffer;
    return 1;
  } else {
    return 0;
  }
}

int main() {
  int k[5];
  cin >> k[0] >> k[1] >> k[2] >> k[3] >> k[4];
  while (comp(k[0], k[1]) || comp(k[1], k[2]) || comp(k[2], k[3]) ||
         comp(k[3], k[4])) {
  }
  cout << k[4] << " " << k[3] << " " << k[2] << " " << k[1] << " " << k[0]
       << endl;
  return 0;
}

#include <cmath>
#include <cstdio>
#include <iostream>
#include <vector>

using namespace std;

int comp(int *a, int *b) {
  int buffer;
  if (*a > *b) {
    buffer = *b;
    *b = *a;
    *a = buffer;
    return 1;
  } else {
    return 0;
  }
}

int main() {
  int a, b, c, d, e;
  int i = 1;
  cin >> a >> b >> c >> d >> e;
  while (i) {
    i = 0;
    i += comp(&a, &b);
    i += comp(&b, &c);
    i += comp(&c, &d);
    i += comp(&d, &e);
  }
  cout << e << " " << d << " " << c << " " << b << " " << a << endl;
  return 0;
}


#include <algorithm>
#include <iostream>
using namespace std;
int main() {
  int a[5];
  for (int i = 0; i < 5; i++) {
    cin >> a[i];
  }
  sort(a, a + 5);
  for (int j = 4; j >= 0; j++) {
    if (j == 0)
      cout << a[0] << endl;
    else
      cout << a[j] << " ";
  }
  return 0;
}

#include <algorithm>
#include <iostream>
using namespace std;
int main() {
  int a[5];
  for (int i = 0; i < 5; i++) {
    cin >> a[i];
  }
  sort(a, a + 5);
  reverse(a, a + 5);
  cout << a[0];
  for (int j = 1; j < 5; j++) {
    cout << " " << a[j];
  }
  cout << endl;
  return 0;
}


#include <algorithm>
#include <stdio.h>
using namespace std;
long long int a[5];
int main() {
  int i;
  for (i = 0; i < 5; i++) {
    scanf("%lld ", &a[i]);
  }
  sort(a, a + 5);
  for (i = 4; i >= 0; i--) {
    if (i != 0)
      printf("%lld ", a[i]);
    else {
      printf("%lld\\n", a[i]);
    }
  }
  return 0;
}


#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int main() {
  vector<int> a;
  int ptr = 0;
  while (cin >> a[ptr++])
    ;
  stable_sort(a.begin(), a.end());
  for (int i = 0; i < a.size(); ++i)
    cout << a[i] << " ";
  cout << endl;
  return 0;
}

#include <algorithm>
#include <functional>
#include <iostream>
#include <vector>
using namespace std;
int main() {
  vector<int> a;
  int ptr = 0;
  int tmp;
  while (cin >> tmp)
    a.push_back(tmp);
  stable_sort(a.begin(), a.end(), greater<int>());
  for (int i = 0; i < a.size(); ++i)
    cout << a[i] << (i == a.size() - 1 ? "" : " ");
  cout << endl;
  return 0;
}


#include <algorithm>
#include <iostream>
using namespace std;
int main() {
  int num[5];

  for (int i = 0; i = 4; i++)
    cin >> num[i];

  sort(num, num + 5);

  for (int i = 4; i = 1; i--)
    cout << num[i] << " ";

  cout << num[0] << "\\n";
}

#include <algorithm>
#include <iostream>
using namespace std;
int main() {
  int in[5];
  for (int i = 0; i < 5; i++)
    cin >> in[i];
  sort(in, in + 5, greater<int>());
  for (int i = 0; i < 4; i++)
    cout << in[i] << " ";
  cout << in[4] << endl;
}


#define _USE_MATH_DEFINES
#include <algorithm>
#include <cmath>
#include <iostream>
#include <queue>
#include <sstream>
#include <stack>

using namespace std;

int main() {
  string str;
  int num[5];
  for (int i = 0; i < 5; i++) {
    scanf("%d", num + i);
  }
  sort(num, num + 5, greater<int>());

  for (int i = 0; i < 5; i++) {
    printf("%d%s", num[i], i == 4 ? '\\n' : ' ');
  }
  return 0;
}

#define _USE_MATH_DEFINES
#include <algorithm>
#include <cmath>
#include <iostream>
#include <queue>
#include <sstream>
#include <stack>

using namespace std;

int main() {
  int num[5];
  for (int i = 0; i < 5; i++) {
    scanf("%d", num + i);
  }
  sort(num, num + 5, greater<int>());

  for (int i = 0; i < 5; i++) {
    printf("%d%s", num[i], i == 4 ? "\\n" : " ");
  }
  return 0;
}


#include <algorithm>
#include <iostream>
using namespace std;

int main() {
  int n[5];

  for (int i = 0; i < 5; i++)
    cin >> n[i];
  sort(n, n + 5);
  for (int i = 4; i >= 0; i++) {
    cout << n[i];
    if (i != 0)
      cout << " ";
  }
  cout << endl;
}

#include <algorithm>
#include <iostream>
using namespace std;

int main() {
  int n[5];

  for (int i = 0; i < 5; i++) {
    cin >> n[i];
  }
  sort(n, n + 5);

  cout << n[4] << " " << n[3] << " " << n[2] << " " << n[1] << " " << n[0]
       << endl;
}


#include <cstdio>
#include <iostream>
using namespace std;

int main() {
  int n;
  scanf("%d", n);
  int Fraction = 1;
  for (int i = 0; i < n; i++) {
    Fraction *= n - i;
  }
  printf("%d\\n", Fraction);
  return 0;
}

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <vector>
using namespace std;

int main() {
  vector<int> Number(5);
  for (int i = 0; i < 5; i++) {
    scanf("%d", &Number[i]);
  }
  sort(Number.begin(), Number.end(), greater<int>());
  for (int i = 0; i < 5; i++) {
    if (i != 4) {
      printf("%d ", Number[i]);
    } else {
      printf("%d\\n", Number[i]);
    }
  }
  return 0;
}


#include <algorithm>
#include <functional>
#include <iostream>

using namespace std;

int main(int argc, char const *argv[]) {
  int target[5];

  while (1) {
    cin >> target[0] >> target[1] >> target[2] >> target[3] >> target[4];

    sort(target, target + 5, greater<int>());

    for (int i = 0; i < 5; i++) {
      cout << (i == 0 ? "" : " ") << target[i];
    }
    cout << endl;
  }
  return 0;
}

#include <algorithm>
#include <functional>
#include <iostream>

using namespace std;

int main(int argc, char const *argv[]) {
  int target[5];

  cin >> target[0] >> target[1] >> target[2] >> target[3] >> target[4];

  sort(target, target + 5, greater<int>());

  for (int i = 0; i < 5; i++) {
    cout << (i == 0 ? "" : " ") << target[i];
  }
  cout << endl;
  return 0;
}


#include <iostream>
using namespace std;

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0208

bool hated(int x) {
  while (x > 0) {
    if (x % 10 == 4 || x % 10 == 6)
      return true;
    x /= 10;
  }
  return false;
}

int main() {
  int n;
  while (cin >> n) {
    if (n == 0)
      break;
    int ans = 1;
    for (int i = 0; i < n - 1; i++) {
      ans++;
      while (hated(ans))
        ans++;
    }
    cout << ans << endl;
  }
  return 0;
}

#include <iostream>
using namespace std;

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0208

int d[] = {0, 1, 2, 3, 5, 7, 8, 9};

int div(int n) {
  if (n >= 8)
    div(n / 8);
  cout << d[n % 8];
}

int main() {
  int n;
  while (cin >> n) {
    if (n == 0)
      break;
    div(n);
    cout << endl;
  }
  return 0;
}


#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
typedef pair<char, int> P;

char buf[1000000];
int main() {
  int n;
  while (scanf("%d", &n), n) {
    sprintf(buf, "%o", n);
    for (char &c : buf) {
      if (c >= '5')
        c += 2;
      if (c == '4')
        c++;
    }
    printf("%s\\n", buf);
  }
  return 0;
}

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
typedef pair<char, int> P;

char buf[11];
int main() {
  int n;
  while (scanf("%d", &n), n) {
    sprintf(buf, "%o", n);
    rep(i, strlen(buf)) {
      if (buf[i] >= '5')
        buf[i] += 2;
      if (buf[i] == '4')
        buf[i]++;
    }
    printf("%s\\n", buf);
  }
  return 0;
}


#include <stdio.h>
int f(long long n) {
  while (n) {
    if (n % 10 == 4 || n % 10 == 6)
      return 0;
    n /= 10;
  }
  return 1;
}
int main() {
  long long n, c, i;
  while (scanf("%lld", &n), n) {
    for (c = i = 0; c < n;) {
      ++i;
      if (f(i))
        ++c;
    }
    printf("%lld\\n", i);
  }
  return 0;
}

#include <stdio.h>
int main() {
  int n;
  char *p, s[32];
  while (scanf("%d", &n), n) {
    sprintf(s, "%o", n);
    for (p = s; *p; ++p)
      if (*p > '4')
        *p += 2;
      else if (*p > '3')
        *p += 1;
    puts(s);
  }
  return 0;
}


/*#include <iostream>

unsigned long long int func(unsigned long long int a);

unsigned long long answ[1000000000];

int main(){
        unsigned long long int n;
        while(std::cin >> n, n){
                unsigned long long int ans = 0;
                unsigned long long int n_=n;
                while(n_--){
                        ans++;
                        unsigned long long int b = func(ans);
                        ans+=b;
                        n-=b;
                }
                std::cout << ans << std::endl;
        }
        return 0;
}

unsigned long long int func(unsigned long long int a){
        int res=1;
        while(a > 0){
                if(a % 10 == 4 || a % 10 == 6)return res;
                a /= 10;
                res*=10;
        }
        return 0;
}*/

#include <iostream>
#include <stack>
#define _m_ 1

const int Ebit[8] = {0, 1, 2, 3, 5, 6, 8, 9};

int main() {
  int n;
  std::stack<int> st;
  while (_m_) {
    std::cin >> n;
    if (n == 0)
      break;
    while (_m_) {
      if (n < 8) {
        st.push(Ebit[n]);
        break;
      }
    }
    int amari = n % 8;
    n /= 8;
    st.push(Ebit[amari]);
  }
  while (st.size()) {
    std::cout << st.top();
    st.pop();
  }
  std::cout << std::endl;
  return 0;
}

/*#include <iostream>

unsigned long long int func(unsigned long long int a);

unsigned long long answ[1000000000];

int main(){
        unsigned long long int n;
        while(std::cin >> n, n){
                unsigned long long int ans = 0;
                unsigned long long int n_=n;
                while(n_--){
                        ans++;
                        unsigned long long int b = func(ans);
                        ans+=b;
                        n-=b;
                }
                std::cout << ans << std::endl;
        }
        return 0;
}

unsigned long long int func(unsigned long long int a){
        int res=1;
        while(a > 0){
                if(a % 10 == 4 || a % 10 == 6)return res;
                a /= 10;
                res*=10;
        }
        return 0;
}*/

#include <iostream>
#include <stack>
#define _m_ 1

const int Ebit[8] = {0, 1, 2, 3, 5, 7, 8, 9};

int main() {
  int n;
  std::stack<int> st;
  while (_m_) {
    std::cin >> n;
    if (n == 0)
      break;
    while (_m_) {
      if (n < 8) {
        st.push(Ebit[n]);
        break;
      }
      int amari = n % 8;
      n /= 8;
      st.push(Ebit[amari]);
    }
    while (st.size()) {
      std::cout << st.top();
      st.pop();
    }
    std::cout << std::endl;
  }
  return 0;
}


#include <algorithm>
#include <iostream>
#include <string>
using namespace std;

int main() {
  int n, i;
  int count;
  while (1) {
    cin >> n;
    count = 0;
    if (n == 0) {
      break;
    }
    i = 0;
    count = 1;
    while (1) {
      if (to_string(count).find("4", 0) == -1 &&
          to_string(count).find("6", 0) == -1) {
        i++;
      }
      if (i == n) {
        cout << count << endl;
        break;
      }

      count++;
    }
  }
}

#include <iostream>
#include <string>
using namespace std;

int main() {
  int set[] = {0, 1, 2, 3, 5, 7, 8, 9};
  int n;
  long ans, keta;
  while (1) {
    cin >> n;
    if (n == 0) {
      break;
    }
    ans = 0;
    keta = 1;
    while (n != 0) {
      ans += keta * set[n % 8];
      keta *= 10;
      n /= 8;
    }
    cout << ans << endl;
  }
}


#include <stdio.h>

int main() {
  int n, i, c;
  char s[16];
  while (scanf("%d", &n)) {
    sprintf(s, "%o", n);
    for (i = 0; c = s[i]; i++) {
      c -= 48;
      printf("%d", c + c / 4 + c / 5);
    }
    printf("\\n");
  }
}

#include <stdio.h>

int main() {
  int n, i, c;
  char s[16];
  while (scanf("%d", &n), n) {
    sprintf(s, "%o", n);
    for (i = 0; c = s[i]; i++) {
      c -= 48;
      printf("%d", c + c / 4 + c / 5);
    }
    printf("\\n");
  }
}


#include <stdio.h>
const int a[8] = {0, 1, 2, 3, 5, 7, 8, 9};
int n;
int main() {
  while (true) {
    scanf("%d", &n);
    if (n == 0)
      break;
    bool flag = false;
    while (n != 0) {
      int val = n / 8;
      flag = flag || val;
      if (flag) {
        printf("%d", a[val]);
      }
      n /= 8;
    }
    printf("\\n");
  }
  return 0;
}

#include <algorithm>
#include <stdio.h>
using namespace std;
const int a[8] = {0, 1, 2, 3, 5, 7, 8, 9};
int n, s[15];
int main() {
  while (true) {
    scanf("%d", &n);
    if (n == 0)
      break;
    for (int i = 0; i < 15; i++) {
      s[i] = a[n % 8];
      n /= 8;
    }
    reverse(s, s + 15);
    bool flag = false;
    for (int i = 0; i < 15; i++) {
      flag = flag || s[i];
      if (flag) {
        printf("%d", s[i]);
      }
    }
    printf("\\n");
  }
  return 0;
}