import std.stdio, std.array, std.conv, std.string, std.algorithm, std.container;

void main() {
  foreach (string line; lines(stdin)) {
    line.chomp.split.map!(to!int).reduce!("a + b").to!string.length.writeln;
  }
}