Go: package main

/*
フィボナッチ数列
*/

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

func fibWithMemo(n int, memo map[int]int) int {
	if n == 0 || n == 1 {
		return 1
	}
	if val, ok := memo[n]; ok {
		return val
	}
	memo[n] = fibWithMemo(n-1, memo) + fibWithMemo(n-2, memo)
	return memo[n]
}

func fib(n int) int {
	memo := make(map[int]int)
	return fibWithMemo(n, memo)
}

func main() {
	scanner := makeScanner(1024)
	n := eGetInt(scanner)
	fmt.Println(fib(n))
}

////////////////////////////////////////////////////////////////////////////////
// ライブラリ
////////////////////////////////////////////////////////////////////////////////
func makeScanner(maxByte int) *bufio.Scanner {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Buffer(make([]uint8, 0, 8192), maxByte)
	return scanner
}
func makeWordScanner() *bufio.Scanner {
	scanner := makeScanner(8192)
	scanner.Split(bufio.ScanWords)
	return scanner
}
func eGetLine(r *bufio.Scanner) string {
	if r.Scan() {
		return r.Text()
	}
	err := r.Err()
	if err != nil {
		log.Fatal(err)
	}
	// EOF
	return ""
}
func eGetInt(r *bufio.Scanner) int {
	line := eGetLine(r)
	return eAtoi(line)
}
func eGetFields(r *bufio.Scanner) []string {
	line := eGetLine(r)
	return strings.Fields(line)
}
func eGetInts(r *bufio.Scanner) []int {
	fields := eGetFields(r)
	ints := make([]int, len(fields))
	for i := 0; i < len(ints); i++ {
		ints[i] = eAtoi(fields[i])
	}
	return ints
}
func eGetChars(r *bufio.Scanner) []string {
	line := eGetLine(r)
	return strings.Split(line, "")
}
func eAtoi(s string) int {
	n, err := strconv.Atoi(s)
	if err != nil {
		log.Fatal(err)
	}
	return n
}

type ints []int

func (s ints) String() string {
	var buf bytes.Buffer
	buf.WriteString("[")
	sep := ""
	for _, v := range s {
		buf.WriteString(fmt.Sprintf("%s%d", sep, v))
		sep = ", "
	}
	buf.WriteString("]")
	return buf.String()
}

func reverse(a ints) ints {
	r := make(ints, len(a))
	for i := 0; i < len(a); i++ {
		r[i] = a[len(a)-1-i]
	}
	return r
}
func max(a ints) (int, bool) {
	if len(a) == 0 {
		return 0, false
	}
	m := a[0]
	for _, e := range a {
		if e > m {
			m = e
		}
	}
	return m, true
}
func min(a []int) int {
	m := a[0]
	for _, v := range a {
		if v < m {
			m = v
		}
	}
	return m
}

func sum(a ints) int {
	if len(a) == 0 {
		return 0
	}
	sum := 0
	for _, e := range a {
		sum += e
	}
	return sum
}
func find(n int, a ints) int {
	for i, v := range a {
		if n == v {
			return i
		}
	}
	return -1
}

C++: #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;

const char wall = '#';
vector<vector<char>> fields;
vector<vector<bool>> used;
vector<vector<ll>> dist;
const int dx[4] = {0, -1, 0, 1};
const int dy[4] = {1, 0, -1, 0};

ll N;
vector<ll> F(44, 0);

ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return b/gcd(a,b)*b;}

void fibo(ll n) {
  if (n == 0) F[0] = 1;
  else if (n == 1) F[1] = 1;
  else F[n] = F[n-1] + F[n-2];
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> N;
  rep(i, N) {
    fibo(i);
  }
  if(N < 2) cout << 1 << endl;
  else cout << F[N-1]+F[N-2] << endl;
  return 0;
}

C++: #include<cstdio>

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

C++: #include<bits/stdc++.h>
#define int long long
using namespace std;
 
signed main(){
	vector<int>a(45);
	a[0]=a[1]=1;
	for(int b=2;b<45;b++)a[b]=a[b-1]+a[b-2];
	int c;
	cin>>c;
	cout<<a[c]<<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 <bits/stdc++.h>

using namespace std;

#define FOR(i,s,e) for((i)=(s);(i)<(int)(e);(i)++)
#define REP(i,e) FOR(i,0,e)

#define all(o) (o).begin(), (o).end()
#define psb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))

typedef long long ll;
typedef pair<int, int> PII;

const double EPS = 1e-10;

const int N = 44;
int n;
int memo[N+1];

//?????????TLE?§£???
//?¨?????????????????????§2^44 - (?????????)

int fib(int k) {
  if (memo[k]) return memo[k];
  return fib(k-1) + fib(k-2);
}

int dp(int k) {
  memset(memo, 0, sizeof(memo));
  if (k<=1) return 1;
  memo[0] = memo[1] = 1;
  for (int i=2; i<=k; i++)
    memo[i] = memo[i-1] + memo[i-2];
  return memo[k];
}

int main() {
//  memset(memo, 0, sizeof(memo));
//  memo[0] = memo[1] = 1;
  scanf("%d ", &n);
//  printf("%d\n", fib(n));
  printf("%d\n", dp(n));

	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] = {0};
  if(n==0 || n == 1){
    return 1;
  }else if(memo[n] != 0){
    return memo[n];
  }else{
    return memo[n] = memo[n-1] + memo[n-2];
  }
}

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

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

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


int main() {
    ios::sync_with_stdio(false);

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

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

C++: #include<bits/stdc++.h>
using namespace std;
#define ll long long
ll fib(ll  n)
{
  ll f[100000];
  ll i;
  f[0] = 1;
  f[1] = 1;
  for (i = 2; i <= n; i++)
      f[i] = f[i-1] + f[i-2];

  return f[n];
}
int main(){
    ll i,j,k,l,n,m;
    cin>>m;
    cout<<fib(m)<<endl;
    return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<cstdlib>
#include<vector>

using namespace std;

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

    vector<int> fibo(n + 1);
    fibo[0] = 1;
    fibo[1] = 1;
    for(int i = 2; i <= n; i++){
        fibo[i] = fibo[i - 2] + fibo[i - 1];
    }
    cout << fibo[n] << endl;
    return 0;
}

C++: #include <bits/stdc++.h>
#include <cmath>

using namespace std;
#define rep(i, n) for (ll i = 0; i < (n); ++i)
//#define rep(i, n) for (int i = 0; i < (n); ++i)
#define sz(x) ll(x.size())
//typedef long long ll;
typedef long long ll;
//typedef pair<int, int> P;
//typedef pair<ll, ll> P;
//const double INF = 1e10;
const ll INF = 10e15;
const ll MINF = -10e10;
//const int INF = INT_MAX / 100;
#define cmin(x, y) x = min(x, y)
#define cmax(x, y) x = max(x, y)


//ifstream myfile("~/Downloads/02.txt");
//ofstream outfile("log.txt");
//outfile << setw(6) << setfill('0') << prefecture << setw(6) << setfill('0') << rank << endl;
// std::cout << std::bitset<8>(9);

//typedef priority_queue<P, vector<P>, greater<P> > PQ_ASK;
const int mod = 1000000007;
const double PI = 3.14159265358979323846;

typedef pair<string, int> P;


string to_upper(string str) {
    int diff = 'a' - 'A';
    for (int i = 0; i < str.size(); i++) {
        char c = str[i];
        if ('A' <= c && c <= 'Z') {
            c += diff;
            str[i] = c;
        }
    }
    return str;
}


int main() {
    vector<ll> fibonacci(50, 0);
    fibonacci[0] = 1;
    fibonacci[1] = 1;
    for (int i = 2; i < 50; i++) {
        fibonacci[i] = fibonacci[i - 1] + fibonacci[i - 2];
    }

    int n;
    cin >> n;
    cout << fibonacci[n] << endl;

}

C++: #ifdef LOCAL_BUILD
#include "pch.h"
#define DLOG(msg) cout << "#" << __LINE__ << ":" << msg << endl;
#define DLOG_V(var)\
  cout << "#" << __LINE__ << ":" << #var << " : " << var << endl;
#else
#include <bits/stdc++.h>
#define DLOG(msg)
#define DLOG_V(var)
#endif
using namespace std;

uint64_t solve(int n) {
  vector<uint64_t> cache(n + 1, 0);
  cache[0] = cache[1] = 1;
  for (int i = 2; i <= n; ++i) {
    cache[i] = cache[i - 1] + cache[i - 2];
  }
  return cache[n];
}

int main() {
  int n;
  cin >> n;
  uint64_t result = solve(n);
  cout << result << endl;
}