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>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>   
#include<limits.h>
#include<list>
#include <array>
using namespace std;
#define i64  long long
#define int  long long
 
#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807
#define INF I64_MAX
#define MOD 1000000007
#define MEM_SIZE = 1e5+5;

template<typename T> void DEBUG(T e){std::cout << e << std::endl;}
template<class T> void DEBUG(string str, T e){std::cout <<str << ">>" << e << std::endl;}
template<typename T> void DEBUG(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ DEBUG(v); } }
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; exit(0);}}



//BELOW
struct mint {
  int x; // typedef long long int;
  mint(int x=0):x((x%MOD+MOD)%MOD){}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= MOD) x -= MOD;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += MOD-a.x) >= MOD) x -= MOD;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= MOD;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
  mint pow(int t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }
 
  // for prime MOD
  mint inv() const {
    return pow(MOD-2);
  }
  mint& operator/=(const mint a) {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const {
    mint res(*this);
    return res/=a;
  }
};
 
 
 
const int MAX = 510000;
 
long long fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
 
// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[n - k] % MOD) % MOD;
}

//-----CODE------//


void solve(void)
{
  int N;
  cin>>N;
  vector<int> vec(50,0);
  vec[0] = 1;
  vec[1] = 1;
  for (int i = 0; i < 48; i++)
  {
    vec[i+2] = vec[i+1] + vec[i];
  }
  cout<<vec[N]<<endl;
  
  
  
  return; 
}


int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(9);
  solve();

 
  return 0;
}

C++: #include <stdio.h>
#define NIL -1

long long fibs[50];

int fibs_(int n){
    if(fibs[n] != NIL)
        return fibs[n];

    if (n >= 2)
        fibs[n] = fibs_(n - 1) + fibs_(n - 2);

    return fibs[n];
}

void init(){
    for(int i = 0; i < 45; i++){
        fibs[i] = NIL;
    }
    fibs[0] = 1;
    fibs[1] = 1;
}


int main(void){
    init();

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

    for(int i = 2; i < n; i++){
        int _;
        _ = fibs_(i);
    }

    printf("%d\n", fibs_(n));

    return 0;
}

C++: // Last Change: 12/28/2018 23:35:37.
#include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;
using ll = long long;

int dp[50];

ll Fib(int n) {
  if (dp[n] == 0) {
    dp[n] = Fib(n - 1) + Fib(n - 2);
  }
  return dp[n];
}

int main() {
  dp[0] = dp[1] = 1;
  int n;
  cin >> n;
  cout << Fib(n) << endl;
}

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

// ?????£??????????????°???????±???????
int fibonacci(int n);

int main()
{
    int num;
    cin >> num;
    int res = 0;

    res = fibonacci(num);
    cout << res << endl;

    //getchar();
    //getchar();

    return 0;
}

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

C++: // ALDS1_10_A.cpp
// Dynamic Programming - Fibonacci Number

#include <iostream>
using namespace std;

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

int main()
{
	int n;
	cin >> n;
	int res = fib(n);
	cout << res << endl;
	return 0;
}

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

int main()
{
  int n;
  cin >> n;

  vector<int> fib(n + 5);

  fib[0] = 1;
  fib[1] = 1;

  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>
using namespace std;

typedef long long ll;

ll table[45];
bool flg[45];

ll fib(int n){

    if(n==0)return 1;
    else if(n==1)return 1;
    else{
        if(flg[n])return table[n];
        else{
            flg[n]=true;
            return table[n]=fib(n-1)+fib(n-2);
        }
    }
}


int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    table[0]=table[1]=1;
    flg[0]=flg[1]=true;
    int n;
    cin >> n;
    cout << fib(n) << endl;
}

C++: #include <iostream>
#include <vector>
#include <stack>
#include <queue>

using namespace std;


int main(){
	int n; cin >> n;
	if (n == 1) cout << 1 << endl;
	if (n == 2) cout << 2 << endl;

	int f1 = 1;
	int f2 = 1;
	int f3 = 0;
	for (int i = 2; i <= n; ++i){
		f3 = f1 + f2;
		f1 = f2;
		f2 = f3;
	}
	cout << f3 << endl;
}

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

//再帰
int fibonacci(int n){
	if(n==0) return 1; //たぶん本当はフィボナッチ数列はf(0)=0 だと思うのだが、問題文がそうなっていたので１を返す。
	else if(n==1) return 1;
	else return fibonacci(n-2) + fibonacci(n-1);
}

//DP
int fibonacci_dp(int n){
	int i;
	int fib[45];

	fib[0]=1;
	fib[1]=1;

	for(i=2; i<=n; i++){
		fib[i]=fib[i-2]+fib[i-1];
	}
	return fib[n];
}

int main() {
	int n;

	cin >> n;
	//cout << fibonacci(n) << endl;
	cout << fibonacci_dp(n) << endl;

	return 0;
}