Go: package main

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

// main
func main() {
	//testFunction()
	solve(bufio.NewScanner(os.Stdin))
}

// test
func testFunction() {
	input := `
3
`
	sc := bufio.NewScanner(strings.NewReader(strings.Trim(input, "\n")))
	solve(sc)
}



func fib(n int, dp map[int]int) int {
	if n == 0 || n == 1 {
		return 1
	}
		if v, ok := dp[n]; ok {
		return v
	}
	r := fib(n - 1, dp) + fib(n - 2, dp)
	dp[n] = r
	return r
}

// solve
func solve(sc *bufio.Scanner) {
	sc.Split(bufio.ScanWords)
	sc.Scan()
	n, _ := strconv.Atoi(sc.Text())
	dp := make(map[int]int)
	r := fib(n, dp)
	fmt.Println(r)
}

C++: // #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define Graph vector<vector<int>>
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1000000007;

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

C++: #include <iostream>

using namespace std;

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

    int a = 1, b = 1;
    if (n < 2) {
        cout << 1 << endl;
    } else {
        int ans;
        for (int i = 2; i <= n; ++i) {
            ans = a + b;
            b = a;
            a = ans;
        }

        cout << ans << endl;
    }

    return 0;
}

C++: // 
#include <bits/stdc++.h>
#define endl "\n"
#define _GLIBCXX_DEBUG //配列外参照エラー表示,gcc依存
#define rep(i,n) for(int i=0;i<int(n);i++)
#define SZ(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> ipair;
template <class T>ostream &operator<<(ostream &o,const vector<T>&v)
{o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}
namespace you {
    std::string to_string(char val) {
        return std::string(1, val);
        // return std::string{val};
        // you::to_string(char)
    }
}

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

    int n;
    vector<int> dp(50);
    cin>>n;
    dp[0]=1,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 <bits/stdc++.h>
#define rep(i, a, b) for (int i = a; i < (b); i++)
#define rrep(i, a, b) for (int i = a; i >= (b); i--)
#define all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <class T>
inline bool chmin(T& a, T b) {
   if (a > b) {
      a = b;
      return true;
   }
   return false;
}
template <class T>
inline bool chmax(T& a, T b) {
   if (a < b) {
      a = b;
      return true;
   }
   return false;
}
void hr() {
   cerr << "--------------" << endl;
}
const int INF = 1001001001;
const int MOD = 1000000007;
// const int MOD = 998244353;
int memo[100];
int f(int n) {
   if (memo[n] != 0) return memo[n];
   if (n == 0 || n == 1) return 1;
   return memo[n] = f(n - 1) + f(n - 2);
}
int main() {
   cin.tie(0);
   ios_base::sync_with_stdio(0);

   int n;
   cin >> n;
   int ans = f(n);
   cout << ans << endl;
   return 0;
}

C++: #include <iostream>

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

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

C++: #include <iostream>
#include <cmath>
#include <vector>

#define MAX_N 44

using namespace std;

int fibonacci[MAX_N];

int fibo(int n){
  if(fibonacci[n]>0){
    return fibonacci[n];
  }else{
    if(n==0 || n==1){
      fibonacci[n]=1;
      return fibonacci[n];
    }else{
      fibonacci[n]=fibo(n-1)+fibo(n-2);
      return fibonacci[n];
    }
  }
}

  


int main(){
  for(int i=0;i<MAX_N;i++){
    fibonacci[i] = 0;
  }


  int n;
  cin >> n;
  cout << fibo(n);
  
}

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

using namespace std;
using ll = long long;
using P = pair<int, int>;

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

    int n;
    cin>>n;
    vector<ll> fibs(n + 1);
    fibs[0] = 1;
    fibs[1] = 1;
    rep(i, n - 1) {
        fibs[i + 2] = fibs[i + 1] + fibs[i];
    }
    cout<<fibs[n]<<endl;
}

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

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

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

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

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

#define int long long

const int N = 44 + 5;
int fib[N];

void pre(){
  fib[0] = 1, fib[1] = 1;
  for(int i = 2; i < N; i++){
	   fib[i] = fib[i - 1] + fib[i - 2];  
	}	
}

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

C++: #include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <string>
#include <cctype>
#include <stack>
#include <queue>
#include <vector>
#include <cstdlib>
#include <list>
#define _USE_MATH_DEFINES
#include <math.h>

using namespace std;

int main() {

	int n;
	int F[44];
	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<algorithm>
using namespace std;

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

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


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

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

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

int F[100]; int N;

int main(){
  cin >> N;
  F[0] = 1;
  F[1] = 1;
  for(int i = 2; i < 45; ++i){
    F[i] = F[i-1] + F[i-2];
  }
  
  cout << F[N] << endl;
}

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

long F[45] = {};

void calcfib(){
	for (long i = 0; i < 45; i++){
		if (i == 0 || i == 1) F[i] = 1;
		else F[i] = F[i - 1] + F[i - 2];
	}
}

int main(){
	long n;
	cin >> n;
	calcfib();
	cout << F[n] << endl;
	return 0;
}

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

int main()
{
 int n; cin>>n;
 vector<ll> fib(n + 1);
 fib.at(0) = 1;
 fib.at(1) = 1;
 for (int i = 2; i <= n; i++)
 {
   fib.at(i) = fib.at(i - 1) + fib.at(i - 2);
 }
 cout << fib.at(n) << endl;

}

C++: #include<algorithm>
#include<climits>
#include<cmath>
#include<iomanip>
#include<iostream>
#include<list>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<stack>
#include<utility>
#include<vector>

#define lint long long
#define REP(i, x, n) for(int i = x ; i < n ; i++)
#define rep(i, n) REP(i, 0, n)
#define repr(i, n) for(int i = n - 1 ; i >= 0 ; i--)
#define SORT(c) sort((c).begin(), (c).end())
#define SORT_INV(c) sort((c).begin(), (c).end(), greater<int>())
#define IINF INT_MAX
#define LLINF LLONG_MAX

using namespace std;

lint fib[50] = {0};

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

C++: #define scanf_s scanf
#include <iostream>
using namespace std;
int F[46] = { 0 };
int fib(int n) 
{
	if (n >= 0) {
		if (n <= 1) { return F[n] = 1; }
		if (F[n] != 0) {
			return F[n];
		}
		return F[n] = fib(n - 1) + fib(n - 2);
	}
}
int main(void)
{
	int n;
	scanf_s("%d", &n);
	printf("%d\n", fib(n));
}