#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 *, long long);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  long long int result;
  scanf("%d", &n);
  result = 1;
  while (n > 0) {
    result *= 3;
    n--;
  }
  printf("%lld\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movq   $0x1,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1168 <main+0x48>
imul   $0x3,-0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1147 <main+0x27>
mov    -0x10(%rbp),%rsi
lea    0xe90(%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),%ecx
test   %ecx,%ecx
jle    114e <main+0x2e>
lea    -0x1(%rcx),%edx
mov    %ecx,%eax
and    $0x7,%eax
cmp    $0x7,%edx
jae    1155 <main+0x35>
mov    $0x1,%esi
jmp    116c <main+0x4c>
mov    $0x1,%esi
jmp    1181 <main+0x61>
and    $0xfffffff8,%ecx
mov    $0x1,%esi
nopl   (%rax)
imul   $0x19a1,%rsi,%rsi
add    $0xfffffff8,%ecx
jne    1160 <main+0x40>
test   %eax,%eax
je     1179 <main+0x59>
lea    (%rsi,%rsi,2),%rsi
add    $0xffffffff,%eax
jne    1170 <main+0x50>
movl   $0x0,0x4(%rsp)
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"%lld\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 sgt i32 %4, 0
br i1 %5, label %6, label %30
6: ; preds = %0
%7 = add i32 %4, -1
%8 = and i32 %4, 7
%9 = icmp ult i32 %7, 7
br i1 %9, label %18, label %10
10: ; preds = %6
%11 = and i32 %4, -8
br label %12
12: ; preds = %12, %10
%13 = phi i64 [ 1, %10 ], [ %15, %12 ]
%14 = phi i32 [ 0, %10 ], [ %16, %12 ]
%15 = mul i64 %13, 6561
%16 = add i32 %14, 8
%17 = icmp eq i32 %16, %11
br i1 %17, label %18, label %12
18: ; preds = %12, %6
%19 = phi i64 [ undef, %6 ], [ %15, %12 ]
%20 = phi i64 [ 1, %6 ], [ %15, %12 ]
%21 = icmp eq i32 %8, 0
br i1 %21, label %28, label %22
22: ; preds = %18, %22
%23 = phi i64 [ %25, %22 ], [ %20, %18 ]
%24 = phi i32 [ %26, %22 ], [ 0, %18 ]
%25 = mul nsw i64 %23, 3
%26 = add i32 %24, 1
%27 = icmp eq i32 %26, %8
br i1 %27, label %28, label %22
28: ; preds = %22, %18
%29 = phi i64 [ %19, %18 ], [ %25, %22 ]
store i32 0, i32* %1
br label %30
30: ; preds = %28, %0
%31 = phi i64 [ %29, %28 ], [ 1, %0 ]
%32 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 %31)
ret i32 0
}