Go: package main

import (
	"bufio"
	"io"
	"os"
	"strconv"
	"fmt"
)

var (
	nstr   func() string
	stdout *bufio.Writer
)

func init() {
	nstr = newReadString(os.Stdin)
	stdout = bufio.NewWriter(os.Stdout)
}

func main() {
	defer stdout.Flush()
	n := nint()
	r := fibonacci(n)
	fmt.Println(r)
}

func fibonacci(n int) int{
	if n == 0 || n == 1{
		return 1
	}else{
		fiList := make([]int, n+1)
		fiList[0] = 1
		fiList[1] = 1
		for i:=2; i<n+1; i++{
			fiList[i] = fiList[i-1] + fiList[i-2]
		}
		return fiList[n]

	}

}

func newReadString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

func nint64() int64 {
	i, err := strconv.ParseInt(nstr(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

func nint() int {
	return int(nint64())
}

func getIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = nint()
	}
	return b
}

func getStringSlice(n int) []string {
	b := make([]string, n)
	for i := 0; i < n; i++ {
		b[i] = nstr()
	}
	return b
}

func gcd(x, y int) int {
	if y == 0 {
		return x
	}
	return gcd(y, x%y)
}

func lcm(x, y int) int {
	return x * y / gcd(x, y)
}

func contains(s []int, e int) bool {
	for _, a := range s {
		if a == e {
			return true
		}
	}
	return false
}

func bin(i int, prefix bool) string {
	i64 := int64(i)

	if prefix {
		return "0b" + strconv.FormatInt(i64, 2)
	} else {
		return strconv.FormatInt(i64, 2)
	}
}

func strReverse(s string) string {
	runes := []rune(s)
	for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {
		runes[i], runes[j] = runes[j], runes[i]
	}

	return string(runes)
}

C++: #include<iostream>
using namespace std;
int main() {
	long long l[44];
	l[0] = 1;
	l[1] = 1;
	for (int i = 2; i < 44; i++)
	{
		l[i] = l[i - 2] + l[i - 1];
	}
	int n;
	cin >> n;
	cout << l[n] << endl;
	char c;
	cin >> c;
}

C++: #include <bits/stdc++.h>
using namespace std;

int dp[50];

int main(){
    int n;
    cin>>n;
    for(int i=0; i<50; ++i)dp[i]=0;
    dp[0]=dp[1]=1;
    for(int i=2; i<=n; ++i){
        dp[i]=dp[i-2]+dp[i-1];
    }
    cout<<dp[n]<<endl;
}

C++: #include <cstdio>
#define NMAX 45

int main() {
    int n;
    scanf("%d", &n);

    if (n == 0 || n == 1) {
        printf("1\n");
    } else {
        int fib[NMAX];
        fib[0] = fib[1] = 1;
        for (int i = 2; i < NMAX; i++) {
            fib[i] = fib[i-1] + fib[i-2];
            if (i == n) {
                printf("%d\n", fib[i]);
                break;
            }
        }
    }
    return 0;
}

C++: #include <stdio.h>
#include <iostream>
using namespace std;

int fib(int n);

int main(void)
{
	int n;
	cin >> n;
	cout << fib(n) << endl;
}

int fib(int n)
{
	if (n == 0 || n == 1) return 1;
	return fib(n - 1) + fib(n - 2);
}

C++: #include <iostream>
using ll = long long;
using namespace std;
#define MAX 50
/* initialize */
int fibs[MAX];

/* main */
int main() {

    int n;
    cin >> n;
    fibs[0]=fibs[1] = 1;
    for (int i = 2; i <= n; i++) {
        fibs[i] = fibs[i-1] + fibs[i-2];
    }
    cout << fibs[n] << "\n";
    return 0;
}

C++: #include <iostream>
#include <sys/time.h>
using namespace std;

int memo[100] = {0};

int fibo(int n){//メモ化再帰を用いて再計算を防ぎ、再帰計算速度を上げる
    if(memo[n] != 0) return memo[n];
    if(n == 0 || n == 1) return 1;
    memo[n] = fibo(n - 1) + fibo(n - 2);
    return memo[n];
}

int main(void){
    int n;
    cin >> n;
    fibo(n);
    cout <<  fibo(n) << endl;
}

C++: #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAXN = 50;
int n;
ll f[MAXN];

void fib(int n){
    if(n == 0||n == 1){
        return;
    }
    int i;
    for(i = 2; i <= n; i++){
        f[i] = f[i-1] + f[i-2];
    }
}
int main(){
    scanf("%d", &n);
    f[0] = 1; f[1] = 1;
    fib(n);
    printf("%lld\n", f[n]);
    return 0;
}

C++: #include<bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (n); ++i)

using namespace std;
using ll = long long;
using v1 = vector<int>;
using vl = vector<long long>;
using v2 = vector<vector<int>>;
using v3 = vector<vector<char>>;

int n;

int fib(int x, int y, int i){
	if(i == n) return x+y;
	i++;
	fib(y, x+y, i);
}

int main(){
	cin >> n;
	if(n == 1 || n == 0){
		cout << 1 << endl;
		return 0;
	}
	cout << fib(1, 1, 2) << endl;
}

C++: #include <iostream>
using namespace std;
int main(){
  int n;
  long long int fib1,fib2,fib3;
  cin>>n;
  fib1=1;
  fib2=1;
  if(n==0){
    cout<<0<<endl;
  }else if(n==1){
    cout<<1<<endl;
  }else if(n>=2){
    for(int i=0;i<n-1;i++){
      fib3=fib1+fib2;
      fib1=fib2;
      fib2=fib3;
    }
    cout<<fib3<<endl;
  }
}

C++: #include <iostream>
using namespace std;

int main() {
  int n; cin >> n;
  int fib[50];
  fib[0] = fib[1] = 1; //初期条件
  //n>=2のとき
  for ( int i = 2; i <= n; i++ ) {
    fib[i] = fib[i-2] + fib[i-1];
  }

  cout << fib[n] << endl;
  return 0;
}

C++: #include "bits/stdc++.h"
#include "math.h"
 
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<int> vin;
typedef vector<vin> vvin;
typedef pair<ll,ll> P;
typedef vector<P> vp;
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define drep(i,a,b) for(ll i=(a);i>=(b);--i)
#define SIZE(a) int((a).size())
const int MOD=1e9+7;

int main(){
  ll n;cin>>n;
  vll dp(n+1,1);
  rep(i,2,n+1){
    dp[i]=dp[i-2]+dp[i-1];
  }
  cout<<dp[n]<<endl;
}