int main(void) {
  int a, b;
  for (; ~scanf("%d%d", &a, &b);) {
    int size = 0;
    int sum = a + b;
    while (sum > 0) {
      size += 1;
      sum /= 10;
    }
    printf("%d\n", size);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
xor    $0xffffffff,%eax
cmp    $0x0,%eax
je     119d <main+0x7d>
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1187 <main+0x67>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
jmp    1161 <main+0x41>
mov    -0x10(%rbp),%esi
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xecc(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    $0xffffffff,%eax
je     11b6 <main+0x96>
mov    $0xcccccccd,%ebx
lea    0xeaf(%rip),%r14
lea    0xea3(%rip),%r15
lea    0xc(%rsp),%r12
lea    0x8(%rsp),%r13
jmp    118f <main+0x6f>
nopl   0x0(%rax)
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    $0xffffffff,%eax
je     11b6 <main+0x96>
mov    0x8(%rsp),%eax
mov    $0x0,%esi
add    0xc(%rsp),%eax
jle    1170 <main+0x50>
xor    %esi,%esi
add    $0x1,%esi
mov    %eax,%ecx
imul   %rbx,%rcx
shr    $0x23,%rcx
cmp    $0x9,%eax
mov    %ecx,%eax
ja     11a0 <main+0x80>
jmp    1170 <main+0x50>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
br label %6
6: ; preds = %22, %0
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%8 = xor i32 %7, -1
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %25
10: ; preds = %6
store i32 0, i32* %4
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = add nsw i32 %11, %12
store i32 %13, i32* %5
br label %14
14: ; preds = %17, %10
%15 = load i32, i32* %5
%16 = icmp sgt i32 %15, 0
br i1 %16, label %17, label %22
17: ; preds = %14
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
store i32 %19, i32* %4
%20 = load i32, i32* %5
%21 = sdiv i32 %20, 10
store i32 %21, i32* %5
br label %14
22: ; preds = %14
%23 = load i32, i32* %4
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %23)
br label %6
25: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = icmp eq i32 %5, -1
br i1 %6, label %23, label %7
7: ; preds = %0, %18
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = add nsw i32 %9, %8
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %7, %12
%13 = phi i32 [ %16, %12 ], [ %10, %7 ]
%14 = phi i32 [ %15, %12 ], [ 0, %7 ]
%15 = add nuw nsw i32 %14, 1
%16 = udiv i32 %13, 10
%17 = icmp ult i32 %13, 10
br i1 %17, label %18, label %12
18: ; preds = %12, %7
%19 = phi i32 [ 0, %7 ], [ %15, %12 ]
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %19)
%21 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%22 = icmp eq i32 %21, -1
br i1 %22, label %23, label %7
23: ; preds = %18, %0
ret i32 0
}