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>
#include<string>
#include<cstdio>
using namespace std;

int *F;

int f(int n){
  if(n == 0 || n == 1){
    return F[n] = 1;
  }

  if(F[n] != 0){
    return F[n];
  }

  return F[n] = f(n - 2) + f(n - 1);
}

int main(){

  int n;

  cin >> n;

  F = new int[n + 1];

  for(int i = 0; i <= n; i++){
    F[i] = 0;
  }

  cout << f(n) << endl;


  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, n) for (int i = (int)(n); i >= 0; i--)
#define REP(i, m, n) for (int i = (int)(m); i <= (int)(n); i++)
#define REPR(i, m, n) for (int i = (int)(m); i >= (int)(n); i--)
#define all(v) v.begin(), v.end()
typedef long long ll;

int main(){
  int n; cin >> n;
  int F[50];
  F[0] = F[1] = 1;
  REP(i, 2, n) F[i] = F[i-1] + F[i-2];

  cout << F[n] << endl;

  return 0;
}

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;
}