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<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 <bits/stdc++.h>
using namespace std;
using ll=long long;

#define REP(i,m,n) for(int i=(int)(m);i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m);i>=(int)(n);--i)
#define debug(x) cout << #x << "=" << (x) << endl;

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;}
template<typename T> void fail(T v){cout << v << endl;exit(0);}
//template end

void solve(){
  int num;
  cin >> num;
  int f[num+1];
  f[0]=1;
  f[1]=1;
  for(int i=2;i<=num;i++)
    f[i]=f[i-1]+f[i-2];
  cout << f[num] << endl;
}

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

C++: #include <iostream>
#define NUM 44

using namespace std;

int main(){
    int n, fib[NUM];

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

    cout << fib[n] << endl;

    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
vector <int> F(100,-1);
int fib(int n){
    if(n==0 || n==1){
        return F[n]=1;
    }
    if(F[n]!=-1){
        return F[n];
    }
    return F[n]=fib(n-2)+fib(n-1);
}
int main() {
	int n;
	cin>>n;
	int ans;
	ans=fib(n);
	cout<<ans<<'\n';
	return 0;
}

C++: #include <cstdint>

using namespace std;

#define MEMO_SIZE 44
int64_t memo[MEMO_SIZE];

void fib_init()
{
  for (uint32_t i = 0; i < MEMO_SIZE; i++) {
    memo[i] = -1;
  }
}

uint32_t fib(uint32_t i)
{
  if (i == 0) {
    return memo[0] = 1;
  } else if (i == 1) {
    return memo[1] = 1;
  } else {
    if (memo[i] != -1)
      return memo[i];
    else {
      return fib(i - 1) + fib(i - 2);
    }
  }
}

#include <iostream>

int32_t main()
{
  fib_init();
  uint32_t i;
  cin >> i;
  cout << fib(i) << endl;
  return 0;
}

C++: #include<iostream>
using namespace std;
int fib(int n)
{
    int F[50];
    if(n<=1) return 1;
    for(int i = 2 ; i <= n; i++)
    {
        F[i] = F[i-1] + F[i-2];
    }
    return F[n];
}

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

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

int dp[50];

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

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

C++: #include<iostream>
#include<algorithm>
#define Max 44
#define null (-1)
using namespace std;
int f[Max];
int fib(int a){
	if(a==0 || a==1)
	return f[a]=1;
	if(f[a]!=null)
	return f[a]; 
	return f[a]=fib(a-1)+fib(a-2);
	
}
main(){
	int n;
	cin>>n;
	for(int i=0;i<=n;i++)
	f[i]=null;
	cout<<fib(n)<<endl;
	return 0;
}

C++: object Main extends App {
  val fibs: Array[Option[Int]] = Array.fill(45)(None)
  val n: Int = io.StdIn.readInt()
  fibs(0) = Some(1); fibs(1) = Some(1)
  println(fib(n))

  def fib(n: Int): Int = fibs(n) match {
    case None =>
      val fibN: Int = fib(n-1) + fib(n-2)
      fibs(n) = Some(fibN)
      fibN
    case Some(x) => x
  }
}

C++: #include <bits/stdc++.h>
#define LOOP(n) for (int _i = 0; _i < (n); _i++)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define RREP(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, r, n) for (int i = (r); i < (n); ++i)
#define ALL(obj) begin(obj), end(obj)
using namespace std;
using ll = long long;
using ull = unsigned long long;
using P = pair<int, int>;
using Graph = vector<vector<int>>;

const int INF = 2100100100;
const int MOD = 1e9 + 7;

// 多次元 vector 生成
template <class T>
vector<T> make_vec(size_t a) {
    return vector<T>(a);
}
template <class T, class... Ts>
auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
template <class T>
bool chmax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
    if (b < a) {
        a = b;
        return 1;
    }
    return 0;
}

int N, M, K, Q, W, H, R, C;
int dp[100];

ll f(int n) {
    if (n <= 1) return 1;
    if (dp[n] != INF) return dp[n];
    ll ret = f(n - 1) + f(n - 2);
    dp[n] = ret;
    return ret;
}

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

    cin >> N;
    REP(i, 100) dp[i] = INF;
    cout << f(N) << endl;
    return 0;
}

C++: // Ref : https://book.mynavi.jp/ec/products/detail/id=35408

#include <iostream>
using namespace std;

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

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

int main() {
  int fib[45];
  fib[0]=1;
  fib[1]=1;
  for(int i=2;i<45;i++){
    fib[i]=fib[i-1]+fib[i-2];
  }

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

  printf("%d\n",fib[n]);
}

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

int main(void)
{
    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;
}