Go: package main

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

//util
var sc = bufio.NewScanner(os.Stdin)

func nextStr() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func printList(list []int) {
	buf := bufio.NewWriter(os.Stdout)
	for _, v := range list {
		buf.Write([]byte(fmt.Sprintf(" %d", v)))
	}
	buf.Write([]byte("\n"))
	buf.Flush()
}

//solve
//単純な場合
func fibonacci_(n int) int {
	if n == 0 || n == 1 {
		return 1
	}
	return fibonacci_(n-2) + fibonacci_(n-1)
}

//メモ再帰の利用
func fibonacci(n int) int {
	if n == 0 || n == 1 {
		F[n] = 1
	}
	//F[n]が計算済みの場合
	if F[n] > 0 {
		return F[n]
	}
	F[n] = fibonacci(n-2) + fibonacci(n-1)
	return F[n]
}

const MAX = 50

var F [MAX]int

func main() {
	sc.Split(bufio.ScanWords)
	n := nextInt()
	fmt.Println(fibonacci(n))

}

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

int main()
{
  int n; cin >> n ;
  int F[50];
  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>

using namespace std;

int fib(int n);

int main() {
  int n;

  //入力
  cin >> n;

  //出力
  cout << fib(n) << endl;

  return 0;
}

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

C++: #include<cstdio>
int main(){
 int n;
 scanf("%d",&n);
 int F[50];
 F[0]=F[1]=1;
 for(int i=2;i<=n;i++)F[i]=F[i-1]+F[i-2];
 printf("%d\n",F[n]);
 return 0;
}

C++: #include <iostream>
#include <stdio.h>

int n;
int F[50];

int main() {
    scanf("%d", &n);
    F[0] = F[1] = 1;
    
    for (int i = 2; i <= n; i++) {
        F[i] = F[i-1] + F[i-2];
    }
    
    printf("%d\n", F[n]);
}

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

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

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

long long dp[101];

long long fib(long long n){
  
  dp[0] = 1;
  dp[1] = 1;

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

  return dp[n];
}

int main(){

  long long n;

  cin>>n;

  memset(dp,0,101);

  cout<<fib(n)<<endl;

  return EXIT_SUCCESS;
}

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

#define N 45

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

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
constexpr int di[] = { 0, 1, 0, -1 }, dj[] = { 1, 0, -1, 0 };
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define SORT(v) sort((v).begin(), (v).end())
#define SORTR(v) sort((v).rbegin(), (v).rend())
#define all(v) (v).begin(), (v).end()
#define vmax 10000
constexpr ll inf = 100000000000000;
/*cout<<fixed<<setprecision(20);cin.tie(0);ios::sync_with_stdio(false);*/

static const int N=101;
static const int W=10010;
int dp[N+1];

int main(){
    int n;
    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++: //#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define all(v) v.begin(), v.end()
using in = int64_t;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
const double PI=3.14159265358979323846;
const in MOD = 1000000007;
const in INF=1<<30;
using P=pair<int,int>;
vector<int> dx={0,1,-1,0};
vector<int> dy={1,0,0,-1};



int main(){
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
cout << fixed << setprecision(10);
    int n;
    cin>>n;
    vector<int> fib(n+1,1);
    REP(i,2,n+1) fib[i]=fib[i-1]+fib[i-2];
    cout<<fib[n]<<endl;
}

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

int main() {
	int n;cin>>n;
	int F[50];
	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>

using namespace std;

int fib[45];

void fibonacci(int n)
{
    fib[0] = fib[1] = 1;
    for(int i = 2; i <= n; i++)
        fib[i] = fib[i - 1] + fib[i - 2];
}

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

C++: #include <bits/stdc++.h>
#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define REP(i, n) for(int i = 0; i < (n); ++i)
#define SORT(v) sort(v.begin(), v.end());
#define pb(a) push_back(a)
using ll = long long;
using namespace std;

ll dp[50];

ll fib(ll k){
    if(dp[k] != -1){
        return dp[k];
    }else if(k == 0){
        dp[k] = 1;
        return dp[k];
    }else if(k == 1){
        dp[k] = 1;
        return dp[k];
    }else{
        dp[k] = fib(k - 1) + fib(k - 2);
        return dp[k];
    }
}


signed main(){
    REP(i, 50){
        dp[i] = -1;
    }
    ll n;
    cin >> n;
    cout << fib(n) << endl;
    return 0;
}