#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 *, double);
int scanf(char *, long long *);
double sqrt(int);
int main() {
  double ans, c = 1, d = 1;
  long long int n, i;
  while (scanf("%lld", &n) == 1) {
    c = 1, d = 1;
    if (n == 0) {
      break;
    } else {
      for (i = 1; i <= n + 1; i++) {
        c = c * (1 + sqrt(5)) / 2;
        d = d * (1 - (1 + sqrt(5)) / 2);
        ans = (c - d) / sqrt(5);
      }
      printf("%.0lf\n", ans);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xeb9(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xeac(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
lea    0xeb0(%rip),%rdi
lea    -0x28(%rbp),%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    1290 <main+0x160>
movsd  0xe86(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe79(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    119c <main+0x6c>
jmp    1290 <main+0x160>
movq   $0x1,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x28(%rbp),%rcx
add    $0x1,%rcx
cmp    %rcx,%rax
jg     127a <main+0x14a>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    $0x5,%edi
call   1050 <sqrt@plt>
movaps %xmm0,%xmm2
movsd  -0x48(%rbp),%xmm0
movsd  0xe23(%rip),%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe1b(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    $0x5,%edi
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
movsd  0xde6(%rip),%xmm2
addsd  %xmm1,%xmm2
movsd  0xde2(%rip),%xmm1
divsd  %xmm1,%xmm2
movsd  0xdce(%rip),%xmm1
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    $0x5,%edi
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    11a4 <main+0x74>
movsd  -0x10(%rbp),%xmm0
lea    0xd8f(%rip),%rdi
call   1030 <printf@plt>
jmp    1159 <main+0x29>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xece(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    1265 <main+0x135>
mov    0x8(%rsp),%rax
test   %rax,%rax
je     1265 <main+0x135>
lea    0xeab(%rip),%r14
lea    0xe9f(%rip),%r15
lea    0x8(%rsp),%r12
cs nopw 0x0(%rax,%rax,1)
test   %rax,%rax
movsd  (%rsp),%xmm0
js     123a <main+0x10a>
xor    %ebx,%ebx
movsd  0xe68(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  %xmm0,(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x5,%edi
call   1050 <sqrt@plt>
movsd  0xe3e(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  (%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xe31(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
mov    $0x5,%edi
call   1050 <sqrt@plt>
movsd  0xe0e(%rip),%xmm1
addsd  %xmm1,%xmm0
mulsd  0xe0a(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0x10(%rsp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rsp)
mov    $0x5,%edi
call   1050 <sqrt@plt>
add    $0x1,%rbx
cmp    0x8(%rsp),%rbx
jle    11b0 <main+0x80>
movsd  (%rsp),%xmm1
subsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
mov    %r14,%rdi
movsd  %xmm0,(%rsp)
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    1265 <main+0x135>
mov    0x8(%rsp),%rax
test   %rax,%rax
jne    1180 <main+0x50>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%lld\00"
@.str.1 = [7 x i8] c"%.0lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca i64
%6 = alloca i64
store i32 0, i32* %1
store double 1.000000e+00, double* %3
store double 1.000000e+00, double* %4
br label %7
7: ; preds = %43, %0
%8 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %5)
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %44
10: ; preds = %7
store double 1.000000e+00, double* %3
store double 1.000000e+00, double* %4
%11 = load i64, i64* %5
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %10
br label %44
14: ; preds = %10
store i64 1, i64* %6
br label %15
15: ; preds = %37, %14
%16 = load i64, i64* %6
%17 = load i64, i64* %5
%18 = add nsw i64 %17, 1
%19 = icmp sle i64 %16, %18
br i1 %19, label %20, label %40
20: ; preds = %15
%21 = load double, double* %3
%22 = call double @sqrt(i32 5)
%23 = fadd double 1.000000e+00, %22
%24 = fmul double %21, %23
%25 = fdiv double %24, 2.000000e+00
store double %25, double* %3
%26 = load double, double* %4
%27 = call double @sqrt(i32 5)
%28 = fadd double 1.000000e+00, %27
%29 = fdiv double %28, 2.000000e+00
%30 = fsub double 1.000000e+00, %29
%31 = fmul double %26, %30
store double %31, double* %4
%32 = load double, double* %3
%33 = load double, double* %4
%34 = fsub double %32, %33
%35 = call double @sqrt(i32 5)
%36 = fdiv double %34, %35
store double %36, double* %2
br label %37
37: ; preds = %20
%38 = load i64, i64* %6
%39 = add nsw i64 %38, 1
store i64 %39, i64* %6
br label %15
40: ; preds = %15
%41 = load double, double* %2
%42 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %41)
br label %43
43: ; preds = %40
br label %7
44: ; preds = %13, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lld\00"
@.str.1 = [7 x i8] c"%.0lf\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %1)
%4 = icmp ne i32 %3, 1
%5 = load i64, i64* %1
%6 = icmp eq i64 %5, 0
%7 = select i1 %4, i1 true, i1 %6
br i1 %7, label %40, label %8
8: ; preds = %0, %32
%9 = phi i64 [ %37, %32 ], [ %5, %0 ]
%10 = phi double [ %33, %32 ], [ undef, %0 ]
%11 = icmp slt i64 %9, 0
br i1 %11, label %32, label %12
12: ; preds = %8, %12
%13 = phi i64 [ %26, %12 ], [ 1, %8 ]
%14 = phi double [ %24, %12 ], [ 1.000000e+00, %8 ]
%15 = phi double [ %19, %12 ], [ 1.000000e+00, %8 ]
%16 = call double @sqrt(i32 5)
%17 = fadd double %16, 1.000000e+00
%18 = fmul double %15, %17
%19 = fmul double %18, 5.000000e-01
%20 = call double @sqrt(i32 5)
%21 = fadd double %20, 1.000000e+00
%22 = fmul double %21, 5.000000e-01
%23 = fsub double 1.000000e+00, %22
%24 = fmul double %14, %23
%25 = call double @sqrt(i32 5)
%26 = add nuw nsw i64 %13, 1
%27 = load i64, i64* %1
%28 = icmp sgt i64 %13, %27
br i1 %28, label %29, label %12
29: ; preds = %12
%30 = fsub double %19, %24
%31 = fdiv double %30, %25
br label %32
32: ; preds = %29, %8
%33 = phi double [ %31, %29 ], [ %10, %8 ]
%34 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %33)
%35 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %1)
%36 = icmp ne i32 %35, 1
%37 = load i64, i64* %1
%38 = icmp eq i64 %37, 0
%39 = select i1 %36, i1 true, i1 %38
br i1 %39, label %40, label %8
40: ; preds = %32, %0
ret i32 0
}