#include <iostream>
#include <string>
#include <cstring>
#include <fstream>
#include <random>
#include <cmath>
#include <iomanip>
#include <climits>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <map>
#include <deque>
#include <map>
#include <set>
#include <unordered_set>
#include <queue>
#include <stack>
#include <list>
#include <unordered_map>
#include <bitset>
#include <sstream>
#include <new>
#include <typeinfo>
#include <iterator>


typedef long long ll;
typedef unsigned long long ull;
constexpr ll mop = 1000000007;
constexpr ll mop2 = 998244353;

using namespace std;

int main() {
	ll a, b;
	while (true) {
		a = b = -1;
		cin >> a >> b;
		if (a == -1 && b == -1) {
			break;
		}
		ll tmp = a + b;
		if (tmp == 0) {
			cout << 1 << endl;
			continue;
		}
		ll ans = 0;
		while (tmp > 0) {
			ans++;
			tmp /= 10;
		}
		cout << ans << endl;
		
	}
}

