let split_on_char sep s =
  let r = ref [] in
  let j = ref (String.length s) in
  for i = String.length s - 1 downto 0 do
    if String.unsafe_get s i = sep then begin
      r := String.sub s (i + 1) (!j - i - 1) :: !r;
      j := i
    end
  done;
  String.sub s 0 !j :: !r
;;

let digit_number s =
  let l   = split_on_char ' ' s in
  let a   = int_of_string(List.nth l 0) in
  let b   = int_of_string(List.nth l 1) in
  let sum = a + b in
  let len = String.length(string_of_int(sum)) in
  print_endline(string_of_int(len))
;;

let rec read_lines ic = 
  try let line = input_line ic in
    digit_number line;
    line :: read_lines ic
  with End_of_file -> [];;

let lines = 
  read_lines stdin
;;