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 "bits/stdc++.h"

#define REP(i,num) for(ll i=0;i<(num);++i)
#define LOOP(i) while(i--)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto pitr=c.begin();pitr!=c.end();++pitr){cout<<*pitr;if(next(pitr,1)!=c.end())cout<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=ll>
T in(){T x; cin >> x; return (x);}
template<typename T=ll,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

vll F;
ll Fib(ll n){
	if(F[n]>0) return F[n];
	return F[n]=Fib(n-1)+Fib(n-2);
}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout<<fixed<<setprecision(10);

	int N=in();
	F.resize(50,-1);
	F[0]=F[1]=1;

	out(Fib(N));
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int dp[45];
  int n;
  dp[1]=1;
  dp[0]=1;
  for(int i=2;i<45;i++){
    dp[i]=dp[i-1]+dp[i-2];
  }
  cin>>n;
  cout<<dp[n]<<endl;
  return 0;
}

C++: #include <iostream>

#define N 50

int dp[N];

int fibonacci(int n) {
    if(n == 0 || n == 1) return dp[n] = 1;
    if(dp[n] != 0) return dp[n];
    return dp[n] = fibonacci(n-2) + fibonacci(n-1);
}

int main() {
    int n;
    std::cin>>n;
    std::cout << fibonacci(n) << std::endl;
}

C++: #include <iostream>

using namespace std;

int A[128];
int fib(int n){
  A[0] =1;
  A[1] =2
  for(int i=2;i<44;++i){
    A[i] =A[i-1];
    if(i>1)A[i]+=A[i-2];
  }
  return A[n-1];

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

C++: #include <bits/stdc++.h>
#include<math.h>
#include<algorithm> 
#define rep(i,n) for (int i = 0; i < (n) ; ++i)
using namespace std;
using ll = long long ;
using P = pair<int, int> ;
#define PI 3.14159265358979323846264338327950
#define INF 1e18

int dp [50] ;
int fib(int x){
    if(x == 1 || x == 0){
        return 1 ;
    }
    if(dp[x]>0){
        return dp[x] ;
    }
    dp[x] = fib(x-1) + fib(x-2) ;
    return fib(x-1) + fib(x-2) ;
}
int main() {
    int n ;
    cin >> n ;
    int ans = fib(n) ;
    cout << ans << endl ; 
}

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

typedef unsigned long long ull;
unsigned long long m[44]={0};


ull fib(int n) {
  if(m[n]!=0){
    return m[n];
  }
  if(n==0||n==1){
    m[n]=1;
    return 1;
  }else{
    m[n]=fib(n-1)+fib(n-2);
    return m[n];
  }
}

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

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

const int MAX = 44;
int MEM[MAX];

int fibonacci(int i) {
  if (MEM[i] != -1) return MEM[i];
  if (i == 0 || i == 1) return 1;
  MEM[i - 2] = fibonacci(i - 2);
  MEM[i - 1] = fibonacci(i - 1);
  return MEM[i - 2] + MEM[i - 1];
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  for (int i = 0; i <= MAX; i++) MEM[i] = -1;

  int i;
  cin >> i;

  cout << fibonacci(i) << endl;

  return 0;
}

C++: #include <iostream>

using namespace std;

int main() {
    int n, dp[50];
    cin >> n;

    dp[0] = dp[1] = 1;

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

    cout << dp[n] << endl;

    return 0;
}

C++: #include <iostream>

using namespace std;

unsigned long long *cache;

unsigned long long fun(int n) {
	if (cache[n] == -1) {
		cache[n] = fun(n-1) + fun(n-2);
	}
	return cache[n];
}

int main() {
	int n;
	cin >> n;
	cache = new unsigned long long[n+2];
	cache[0] = cache[1] = 1;
	for (int i = 2;i<n+2;i++) {
		cache[i] = -1;
	}
	fun(n);
	cout << cache[n] << endl;
	return 0;

}

C++: #include <iostream>
#include <sstream>
#include <cstdio>
#include <stdlib.h>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int f[45];
int fib(int n){
  if(n==1||n==0)return 1;
  if(f[n]!=0)return f[n];
  else return f[n]=fib(n-1)+fib(n-2);
}
int main(){
  int  n;
  cin>>n;
  cout<<fib(n)<<endl;



  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define numrep(i,n) for(int i=1;i<=n;i++)
#define bitrep(n) for(int bit=0;bit<(1<<n);bit++)
#define ll int64_t
#define all(v) v.begin(), v.end()

int main() {

int n; cin>>n;

vector<ll> dp(45);
dp[0]=1;
dp[1]=1;

for(int i=2;i<45;i++) dp[i]=dp[i-1]+dp[i-2];

cout << dp[n] << endl;

return 0;
}

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

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

C++: #include <iostream>
#include <cstring>
using namespace std;
typedef unsigned long long ull;

ull dp[100];

ull fib(int n) 
{
    if (n == 1 || n == 0) return 1;
    if (~dp[n]) return dp[n];
    return dp[n] = fib(n-1) + fib(n-2);
}

int main(void)
{
  int N;
  cin >> N;
  memset(dp, -1, sizeof(dp));
  cout << fib(N) << endl;
}

C++: #include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
/* 動的計画法
int main(){
    int n;
    int dp[100];
    dp[0]=1;
    dp[1]=1;
    cin >> n;
    for(int i=2;i<=n;i++){
        dp[i]=dp[i-1]+dp[i-2];
        //printf("dp[%d]=%d\n",i,dp[i]);
    }
    

    cout<<dp[n]<<endl;
}
*/
//メモ化再帰
int dp[100];
int n;
int fib(int n){
    if(n==0||n==1)return 1;
    if(dp[n]!=-1)return dp[n];
    return dp[n]=fib(n-1)+fib(n-2);
}

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

C++: #include <algorithm>
#include<iostream>
#include<vector>
#include<list>
#include<map>
#include<set>
#include<string>
#include <sstream>

#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<limits.h>

using namespace std;


int main(){
  long ii,jj,kk;
  vector<int> ret;
  long long fib[100];

  int n;

  cin >> n;

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

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

  cout << fib[n] << endl;

  
  
  return 0;
}