#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 */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, int);
scalar_t__ scanf(char *, int *);
int main() {
  int price[7] = {1, 2, 5, 10, 20, 50, 100};
  int p, times, i;
  while (scanf("%d", &p) != EOF) {
    times = 0;
    times += p / 100;
    p = p % 100;
    times += p / 50;
    p = p % 50;
    times += p / 20;
    p = p % 20;
    times += p / 10;
    p = p % 10;
    times += p / 5;
    p = p % 5;
    times += p / 2;
    p = p % 2;
    times += p;
    printf("%d\n", times);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec2(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x24(%rbp),%rsi
call   1040 <scanf@plt>
mov    0x2e78(%rip),%rcx
cmp    (%rcx),%rax
je     1257 <main+0x137>
movl   $0x0,-0x28(%rbp)
mov    -0x24(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
add    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    $0x32,%ecx
cltd
idiv   %ecx
add    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%eax
mov    $0x32,%ecx
cltd
idiv   %ecx
mov    %edx,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    $0x14,%ecx
cltd
idiv   %ecx
add    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%eax
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
add    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %edx,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%esi
lea    0xdd2(%rip),%rdi
call   1030 <printf@plt>
jmp    1159 <main+0x39>
xor    %eax,%eax
add    $0x30,%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
call   1040 <scanf@plt>
mov    0x2ea3(%rip),%r13
cmp    0x0(%r13),%rax
je     1254 <main+0x134>
lea    0xead(%rip),%r14
lea    0xea3(%rip),%r15
lea    0xc(%rsp),%r12
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movslq 0xc(%rsp),%rcx
imul   $0x51eb851f,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rax
add    %edx,%eax
imul   $0x64,%eax,%edx
sub    %edx,%ecx
movsbl %cl,%edx
lea    (%rdx,%rdx,4),%esi
lea    (%rdx,%rsi,8),%edx
movzwl %dx,%edx
movswl %dx,%esi
shr    $0xf,%edx
shr    $0xb,%esi
add    %dl,%sil
movsbl %sil,%edx
add    %edx,%eax
movzbl %dl,%edx
imul   $0x32,%edx,%edx
sub    %dl,%cl
movsbl %cl,%ecx
imul   $0x67,%ecx,%edx
movzwl %dx,%esi
shr    $0xb,%edx
shr    $0xf,%esi
add    %dl,%sil
movsbl %sil,%edx
add    %edx,%eax
movzbl %dl,%edx
shl    $0x2,%edx
lea    (%rdx,%rdx,4),%edx
sub    %dl,%cl
movsbl %cl,%ecx
imul   $0x67,%ecx,%edx
movzwl %dx,%esi
shr    $0xa,%edx
shr    $0xf,%esi
add    %dl,%sil
movsbl %sil,%edx
add    %edx,%eax
movzbl %dl,%edx
add    %edx,%edx
lea    (%rdx,%rdx,4),%edx
sub    %dl,%cl
movsbl %cl,%ecx
imul   $0x67,%ecx,%edx
movzwl %dx,%esi
shr    $0x9,%edx
shr    $0xf,%esi
add    %dl,%sil
movsbl %sil,%edx
add    %edx,%eax
movzbl %dl,%edx
lea    (%rdx,%rdx,4),%edx
sub    %dl,%cl
mov    %ecx,%ebx
shr    $0x7,%bl
add    %cl,%bl
mov    %ebx,%edx
sar    %dl
movsbl %dl,%esi
add    %eax,%esi
and    $0xfe,%bl
sub    %bl,%cl
movsbl %cl,%eax
mov    %eax,0xc(%rsp)
add    %eax,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <scanf@plt>
cmp    0x0(%r13),%rax
jne    1170 <main+0x50>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.price = [7 x i32] [i32 1, i32 2, i32 5, i32 10, i32 20, i32 50, i32 100]
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = bitcast [7 x i32]* %2 to i8*
br label %7
7: ; preds = %11, %0
%8 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%9 = load i64, i64* @EOF
%10 = icmp ne i64 %8, %9
br i1 %10, label %11, label %53
11: ; preds = %7
store i32 0, i32* %4
%12 = load i32, i32* %3
%13 = sdiv i32 %12, 100
%14 = load i32, i32* %4
%15 = add nsw i32 %14, %13
store i32 %15, i32* %4
%16 = load i32, i32* %3
%17 = srem i32 %16, 100
store i32 %17, i32* %3
%18 = load i32, i32* %3
%19 = sdiv i32 %18, 50
%20 = load i32, i32* %4
%21 = add nsw i32 %20, %19
store i32 %21, i32* %4
%22 = load i32, i32* %3
%23 = srem i32 %22, 50
store i32 %23, i32* %3
%24 = load i32, i32* %3
%25 = sdiv i32 %24, 20
%26 = load i32, i32* %4
%27 = add nsw i32 %26, %25
store i32 %27, i32* %4
%28 = load i32, i32* %3
%29 = srem i32 %28, 20
store i32 %29, i32* %3
%30 = load i32, i32* %3
%31 = sdiv i32 %30, 10
%32 = load i32, i32* %4
%33 = add nsw i32 %32, %31
store i32 %33, i32* %4
%34 = load i32, i32* %3
%35 = srem i32 %34, 10
store i32 %35, i32* %3
%36 = load i32, i32* %3
%37 = sdiv i32 %36, 5
%38 = load i32, i32* %4
%39 = add nsw i32 %38, %37
store i32 %39, i32* %4
%40 = load i32, i32* %3
%41 = srem i32 %40, 5
store i32 %41, i32* %3
%42 = load i32, i32* %3
%43 = sdiv i32 %42, 2
%44 = load i32, i32* %4
%45 = add nsw i32 %44, %43
store i32 %45, i32* %4
%46 = load i32, i32* %3
%47 = srem i32 %46, 2
store i32 %47, i32* %3
%48 = load i32, i32* %3
%49 = load i32, i32* %4
%50 = add nsw i32 %49, %48
store i32 %50, i32* %4
%51 = load i32, i32* %4
%52 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %51)
br label %7
53: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
br i1 %5, label %37, label %6
6: ; preds = %0, %6
%7 = load i32, i32* %1
%8 = sdiv i32 %7, 100
%9 = srem i32 %7, 100
%10 = trunc i32 %9 to i8
%11 = sdiv i8 %10, 50
%12 = sext i8 %11 to i32
%13 = add nsw i32 %8, %12
%14 = srem i8 %10, 50
%15 = sdiv i8 %14, 20
%16 = sext i8 %15 to i32
%17 = add nsw i32 %13, %16
%18 = srem i8 %14, 20
%19 = sdiv i8 %18, 10
%20 = sext i8 %19 to i32
%21 = add nsw i32 %17, %20
%22 = srem i8 %18, 10
%23 = sdiv i8 %22, 5
%24 = sext i8 %23 to i32
%25 = add nsw i32 %21, %24
%26 = srem i8 %22, 5
%27 = sdiv i8 %26, 2
%28 = sext i8 %27 to i32
%29 = add nsw i32 %25, %28
%30 = srem i8 %26, 2
%31 = sext i8 %30 to i32
store i32 %31, i32* %1
%32 = add nsw i32 %29, %31
%33 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %32)
%34 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%35 = load i64, i64* @EOF
%36 = icmp eq i64 %34, %35
br i1 %36, label %37, label %6
37: ; preds = %6, %0
ret i32 0
}