#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int input;
  int amountSymbols = 1;
  scanf("%d", &input);
  if (input < 0) {
    input *= -1;
    amountSymbols += 1;
  }
  for (; input > 9; input /= 10) {
    amountSymbols += 1;
  }
  printf("%d\n", amountSymbols);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jge    1160 <main+0x40>
imul   $0xffffffff,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1165 <main+0x45>
cmpl   $0x9,-0x8(%rbp)
jle    118b <main+0x6b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    1165 <main+0x45>
mov    -0xc(%rbp),%esi
lea    0xe6e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
mov    $0x1,%esi
test   %eax,%eax
js     1146 <main+0x26>
cmp    $0xa,%eax
jae    1156 <main+0x36>
jmp    1178 <main+0x58>
neg    %eax
mov    %eax,0x4(%rsp)
mov    $0x2,%esi
cmp    $0xa,%eax
jb     1178 <main+0x58>
mov    $0xcccccccd,%ecx
nopl   0x0(%rax,%rax,1)
mov    %eax,%edx
add    $0x1,%esi
mov    %eax,%eax
imul   %rcx,%rax
shr    $0x23,%rax
cmp    $0x63,%edx
ja     1160 <main+0x40>
mov    %eax,0x4(%rsp)
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

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