Go: package main

/*
フィボナッチ数列
*/

import (
	"bufio"
	"bytes"
	"fmt"
	"log"
	"os"
	"strconv"
	"strings"
)

func fibWithMemo(n int, memo map[int]int) int {
	if n == 0 || n == 1 {
		return 1
	}
	if val, ok := memo[n]; ok {
		return val
	}
	memo[n] = fibWithMemo(n-1, memo) + fibWithMemo(n-2, memo)
	return memo[n]
}

func fib(n int) int {
	memo := make(map[int]int)
	return fibWithMemo(n, memo)
}

func main() {
	scanner := makeScanner(1024)
	n := eGetInt(scanner)
	fmt.Println(fib(n))
}

////////////////////////////////////////////////////////////////////////////////
// ライブラリ
////////////////////////////////////////////////////////////////////////////////
func makeScanner(maxByte int) *bufio.Scanner {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Buffer(make([]uint8, 0, 8192), maxByte)
	return scanner
}
func makeWordScanner() *bufio.Scanner {
	scanner := makeScanner(8192)
	scanner.Split(bufio.ScanWords)
	return scanner
}
func eGetLine(r *bufio.Scanner) string {
	if r.Scan() {
		return r.Text()
	}
	err := r.Err()
	if err != nil {
		log.Fatal(err)
	}
	// EOF
	return ""
}
func eGetInt(r *bufio.Scanner) int {
	line := eGetLine(r)
	return eAtoi(line)
}
func eGetFields(r *bufio.Scanner) []string {
	line := eGetLine(r)
	return strings.Fields(line)
}
func eGetInts(r *bufio.Scanner) []int {
	fields := eGetFields(r)
	ints := make([]int, len(fields))
	for i := 0; i < len(ints); i++ {
		ints[i] = eAtoi(fields[i])
	}
	return ints
}
func eGetChars(r *bufio.Scanner) []string {
	line := eGetLine(r)
	return strings.Split(line, "")
}
func eAtoi(s string) int {
	n, err := strconv.Atoi(s)
	if err != nil {
		log.Fatal(err)
	}
	return n
}

type ints []int

func (s ints) String() string {
	var buf bytes.Buffer
	buf.WriteString("[")
	sep := ""
	for _, v := range s {
		buf.WriteString(fmt.Sprintf("%s%d", sep, v))
		sep = ", "
	}
	buf.WriteString("]")
	return buf.String()
}

func reverse(a ints) ints {
	r := make(ints, len(a))
	for i := 0; i < len(a); i++ {
		r[i] = a[len(a)-1-i]
	}
	return r
}
func max(a ints) (int, bool) {
	if len(a) == 0 {
		return 0, false
	}
	m := a[0]
	for _, e := range a {
		if e > m {
			m = e
		}
	}
	return m, true
}
func min(a []int) int {
	m := a[0]
	for _, v := range a {
		if v < m {
			m = v
		}
	}
	return m
}

func sum(a ints) int {
	if len(a) == 0 {
		return 0
	}
	sum := 0
	for _, e := range a {
		sum += e
	}
	return sum
}
func find(n int, a ints) int {
	for i, v := range a {
		if n == v {
			return i
		}
	}
	return -1
}

Python: n = int(input())

for i in range(n+1):
    if i == 0 or i == 1:
        a = b = c = 1
    else:
        c = a + b
        a, b = b, c
print(c)

Python: n = int(input())

a0 = 1
a1 = 1

aList = [a0, a1]

if n == 0:
    print(a0)
    exit()
elif n == 1:
    print(a1)
    exit()
else:
    for i in range(2, n+1):
        aList.append(aList[i-1] + aList[i-2])

    print(aList[n])

Python: def fib(numbers, find):
    if len(numbers) <= find:
        numbers.append(numbers[-1] + numbers[-2])
        fib(numbers, find)
    else:
        print(numbers)
        print(numbers[find-1])


# n = 4
n = int(input())
number_list = []


if n == 0 or n == 1:
    print(1)
else:
    number_list.append(n-2)
    number_list.append(n-1)
    fib(number_list, n)

Python: dp = [0]*100
dp[0] = 1
dp[1] = 1

def fib(n):
    if dp[n]!=0:
        return dp[n]
    else:
        dp[n] = fib(n-1) + fib(n-2)
    return dp[n]
    
print(fib(int(input())))

Python: import sys
n = int(input())
dp = [0] * (n + 1)
dp[0] = 1
dp[1] = 1
if n == 0:
    print(1)
    sys.exit()
elif n == 1:
    print(1)
    sys.exit()

for i in range(2, n+1):
    dp[i] = dp[i-1] + dp[i-2]

print(dp[n])

Python: fib = [0] * 45

fib[0] = fib[1] = 1

for i in range(2, 45):
    fib[i] = fib[i - 1] + fib[i - 2]

print(fib[int(input())])

Python: n = int(input())

dp = [1]*45

for i in range(2, n+1):
    dp[i] = dp[i-1] + dp[i-2]

print(dp[n])

Python: 
f = [-1 for i in range(45)]
f[0] = f[1] = 1

def fib(n):
    global f
    for i in range(2,n+1):
        f[i] = f[i - 1] + f[i - 2]
        #print(i,f[i])
    return f[n]

if __name__ == "__main__":
    n = input()
    n = int(n)
    #print(type(n))
    print(fib(n))

Python: n = int(input())

def fb(num):
    a, b = 1, 0
    for i in range(num):
        a, b = a + b, a
    return b

print(fb(n+1))

Python: n = int(input())

fib = []
for i in range(n+1):
    if i <=1 :
        fib.append(1)
    if i > 1 :
        fib.append( fib[i-2] + fib[i-1] )

print(fib[n])

Python: n = int(input())

MAX = 45
table = [0] * MAX
for i in range(MAX):
    # print(n)
    if i == 0 or i == 1:
        table[i] = 1
    else:
        table[i] = table[i - 1] + table[i - 2]

print(table[n])

Python: # -*- coding:utf-8 -*-


def memoize(proc):
    cache = {}

    def helper(*args, **kargs):
        if args not in cache:
            cache[args] = proc(*args, **kargs)
        return cache[args]

    return helper


@memoize
def fib(n):
    if n < 2:
        return 1
    else:
        return fib(n - 1) + fib(n - 2)


if __name__ == "__main__":
    print(fib(int(input())))

Python: N = int(input())
dp = [0] * (N + 1)
if N == 0:
    print(0)
    exit()
if N == 1:
    print(1)
    exit()
dp[0] = 1
dp[1] = 1
for i in range(2, N + 1):
    dp[i] = dp[i - 1] + dp[i - 2]

print(dp[-1])

Python: # 34

n = int(input())

dp = [None] * (n+1)
dp[0] = 1
dp[1] = 1

for i in range(n-1):
    dp[i+2] = dp[i] + dp[i+1]

print(dp[n])

Python: import sys
import itertools
# import numpy as np
import time
import math
 
sys.setrecursionlimit(10 ** 7)
 
from collections import defaultdict
 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(input())

dp = [0] * (N + 1)
dp[0] = 1
dp[1] = 1

def fib(n):
    if dp[n] > 0:
        return dp[n]
    
    dp[n] = fib(n - 1) + fib(n - 2)
    return dp[n]

print(fib(N))

Python: n = int(input())
dp = [0]*(n+1)
dp[0] = dp[1] = 1
for i in range(2,n+1):
    dp[i] = dp[i-1] + dp[i-2]
print(dp[n])

Python: n = int(input())
data = []
x = []

if n == 0:
    print('1')
data.append(1)
if n == 1:
    print('1')
data.append(1)

if n >= 2:
    for i in range(2, n+1):
    #print(sum(data[i-2:i+1]))
    #print(data[1])
    #data.append(data[i])
        x = sum(data[i-2:i+1])
        data.append(x)
    #print(i, x)
        i = i + 1
    print(x)

Python: #coding:utf-8
n = int(input())
F = [False for i in range(n+1)]
def fib(n):
    if n == 1 or n == 2:
        F[n] = 1
        return 1
    if F[n]:
        return F[n]
    F[n] = fib(n-2) + fib(n-1)
    return F[n]

a = fib(n)
print(a)

Python: N = int(input())
dp = [ -1 for x in range(50)]
def fib(n):
    if n == 0 or n == 1:
        dp[n] = 1
        return dp[n]
    if dp[n] != -1:
        return dp[n]
    dp[n] = fib(n-1)+fib(n-2)
    return dp[n]
print(fib(N))

Python: n = int(input())
fib = [1, 1] + [0] * n
for i in range(2, n+1):
    fib[i] = fib[i-1] + fib[i-2]
print(fib[n])

Python: dp = {}


def fib(n):
    if n in dp:
        return dp[n]
    else:
        if n <= 1:
            dp[n] = 1
        else:
            dp[n] = fib(n-1) + fib(n-2)
        return dp[n]


n = int(input())
print(fib(n))

Python: num = int(input())
fibtbl = [ 0 for x in range(50)]
fibtbl[0] = 1
fibtbl[1] = 1

def fib(n):
    global fitbl
    
    if n == 0:
        return 1
    if n == 1:
        return 1
    
    if fibtbl[n-1] != 0:
        p = fibtbl[n-1]
    else:
        p = fib(n-1)
    
    if fibtbl[n-2] != 0:
        pp = fibtbl[n-2]
    else:
        pp = fib(n-2)
    
    fibtbl[n] = p + pp
    return p + pp
    

print(fib(num))

Python: fib=[0]*45
fib[0]=1
fib[1]=1

n=int(input())

for i in range(2,45):
    fib[i]=fib[i-1]+fib[i-2]
    
    
print(fib[n])

Python: import sys
#import numpy as np

#sys.setrecursionlimit(10**6)
#readline = sys.stdin.readline

n = int(input())

l = [1,1]

def f(i):
    global l
    if i <= 1:
        return 1
    else:
        return l[i-1] + l[i-2]

for i in range(2,n+1):
    l.append(f(i))

print(l[n])