#include <iostream>
using namespace std;

int main() {
	int a, b, c, e, f;
	cin >> f;
	for (int i = 0; i <= f; i++) {
		cin >> a >> b;
		c = a + b;
		e = 1;
		while (true) {
			if (c < 10) {
				break;
			}
			c = c / 10;
			e = e + 1;
		}
		cout << e << endl;
	}
	return 0;
}