import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();

		int dataNum = 0;
		while (true) {
			String input = br.readLine();
			if (input == null || "".equals(input)) break;

			int a = Integer.parseInt(input.split(" ")[0]);
			int b = Integer.parseInt(input.split(" ")[1]);

			if (dataNum > 200) break;
			if ((a == 0) && (b == 0)) break;
			if (!((a >= 0 && a <= 1000000) && (b >= 0 && b <= 1000000))) break;

			System.out.println(String.valueOf(a + b).length());
			dataNum++;
		}
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();

		int dataNum = 0;
		while (true) {
			String input = br.readLine();
			if (input == null || "".equals(input)) break;

			int a = Integer.parseInt(input.split(" ")[0]);
			int b = Integer.parseInt(input.split(" ")[1]);

			if (dataNum > 200) break;
			if ((a == 0) && (b == 0)) break;
			if (!((a >= 0 && a <= 1000000) && (b >= 0 && b <= 1000000))) break;

			System.out.println(String.valueOf(a + b).length());
			dataNum++;
		}
	}
} Main public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();

		int dataNum = 0;
		while (true) {
			String input = br.readLine();
			if (input == null || "".equals(input)) break;

			int a = Integer.parseInt(input.split(" ")[0]);
			int b = Integer.parseInt(input.split(" ")[1]);

			if (dataNum > 200) break;
			if ((a == 0) && (b == 0)) break;
			if (!((a >= 0 && a <= 1000000) && (b >= 0 && b <= 1000000))) break;

			System.out.println(String.valueOf(a + b).length());
			dataNum++;
		}
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();

		int dataNum = 0;
		while (true) {
			String input = br.readLine();
			if (input == null || "".equals(input)) break;

			int a = Integer.parseInt(input.split(" ")[0]);
			int b = Integer.parseInt(input.split(" ")[1]);

			if (dataNum > 200) break;
			if ((a == 0) && (b == 0)) break;
			if (!((a >= 0 && a <= 1000000) && (b >= 0 && b <= 1000000))) break;

			System.out.println(String.valueOf(a + b).length());
			dataNum++;
		}
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) StringBuilder sb = new StringBuilder(); sb new StringBuilder() int dataNum = 0; dataNum 0 while (true) {
			String input = br.readLine();
			if (input == null || "".equals(input)) break;

			int a = Integer.parseInt(input.split(" ")[0]);
			int b = Integer.parseInt(input.split(" ")[1]);

			if (dataNum > 200) break;
			if ((a == 0) && (b == 0)) break;
			if (!((a >= 0 && a <= 1000000) && (b >= 0 && b <= 1000000))) break;

			System.out.println(String.valueOf(a + b).length());
			dataNum++;
		} true {
			String input = br.readLine();
			if (input == null || "".equals(input)) break;

			int a = Integer.parseInt(input.split(" ")[0]);
			int b = Integer.parseInt(input.split(" ")[1]);

			if (dataNum > 200) break;
			if ((a == 0) && (b == 0)) break;
			if (!((a >= 0 && a <= 1000000) && (b >= 0 && b <= 1000000))) break;

			System.out.println(String.valueOf(a + b).length());
			dataNum++;
		} String input = br.readLine(); input br.readLine() br.readLine br if (input == null || "".equals(input)) break; input == null || "".equals(input) input == null input null "".equals(input) "".equals "" input break; int a = Integer.parseInt(input.split(" ")[0]); a Integer.parseInt(input.split(" ")[0]) Integer.parseInt Integer input.split(" ")[0] input.split(" ") input.split input " " 0 int b = Integer.parseInt(input.split(" ")[1]); b Integer.parseInt(input.split(" ")[1]) Integer.parseInt Integer input.split(" ")[1] input.split(" ") input.split input " " 1 if (dataNum > 200) break; dataNum > 200 dataNum 200 break; if ((a == 0) && (b == 0)) break; (a == 0) && (b == 0) (a == 0) a 0 (b == 0) b 0 break; if (!((a >= 0 && a <= 1000000) && (b >= 0 && b <= 1000000))) break; !((a >= 0 && a <= 1000000) && (b >= 0 && b <= 1000000)) ((a >= 0 && a <= 1000000) && (b >= 0 && b <= 1000000)) (a >= 0 && a <= 1000000) a >= 0 a 0 a <= 1000000 a 1000000 (b >= 0 && b <= 1000000) b >= 0 b 0 b <= 1000000 b 1000000 break; System.out.println(String.valueOf(a + b).length()) System.out.println System.out System System.out String.valueOf(a + b).length() String.valueOf(a + b).length String.valueOf(a + b) String.valueOf String a + b a b dataNum++ dataNum String[] args args public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();

		int dataNum = 0;
		while (true) {
			String input = br.readLine();
			if (input == null || "".equals(input)) break;

			int a = Integer.parseInt(input.split(" ")[0]);
			int b = Integer.parseInt(input.split(" ")[1]);

			if (dataNum > 200) break;
			if ((a == 0) && (b == 0)) break;
			if (!((a >= 0 && a <= 1000000) && (b >= 0 && b <= 1000000))) break;

			System.out.println(String.valueOf(a + b).length());
			dataNum++;
		}
	}
} public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();

		int dataNum = 0;
		while (true) {
			String input = br.readLine();
			if (input == null || "".equals(input)) break;

			int a = Integer.parseInt(input.split(" ")[0]);
			int b = Integer.parseInt(input.split(" ")[1]);

			if (dataNum > 200) break;
			if ((a == 0) && (b == 0)) break;
			if (!((a >= 0 && a <= 1000000) && (b >= 0 && b <= 1000000))) break;

			System.out.println(String.valueOf(a + b).length());
			dataNum++;
		}
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();

		int dataNum = 0;
		while (true) {
			String input = br.readLine();
			if (input == null || "".equals(input)) break;

			int a = Integer.parseInt(input.split(" ")[0]);
			int b = Integer.parseInt(input.split(" ")[1]);

			if (dataNum > 200) break;
			if ((a == 0) && (b == 0)) break;
			if (!((a >= 0 && a <= 1000000) && (b >= 0 && b <= 1000000))) break;

			System.out.println(String.valueOf(a + b).length());
			dataNum++;
		}
	}
}