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 f[45] = {};

int fib(int n);

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

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

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

using ll = long long;
#define REP(i,n) for(int i=0; i < (n); ++i)
#define REPR(i,n) for(int i=(n); i >= 0; --i)
#define FOR(i, m, n) for(int i = (m); i < (n); ++i)

#define INF 1e9
vector<ll> memo;
ll fib(int a){
  if(a == 0 || a== 1){
    return 1;
  }
  if(memo[a] != -1){
    return memo[a];
  }
  return memo[a] = (fib(a-1) + fib(a-2));
}

int main(){
  int n;
  cin >> n;
  memo.resize(50, -1);
  cout << fib(n) << endl;
  return 0;
}

C++: /*
 * ALDS1_10_A.cpp
 *
 *  Created on: May 5, 2018
 *      Author: 13743
 */

#include<iostream>

using namespace std;

int F[44];

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

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

	F[0] = F[1] = 1;

	cout << fib(n) << endl;
}

C++: #include <iostream>

using namespace std;

int fib(int n);

int memo[45];

int main() {
  int n;

  //入力
  cin >> n;

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

  return 0;
}

int fib(int n){
  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 <iostream>
using namespace std;
int num;

int fib(int n) {
    if (n ==0 || n == 1) {
        return 1;
    }
    return fib(n-1) + fib(n - 2);
}
int main(void) {
    cin >> num;
    cout << fib(num) << endl;
    
    
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cassert>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define rep(i,n) FOR(i,0,n)
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define vint vector<int>
#define vdouble vector<double>
#define vstring vector<string>
using namespace std;

#include<map>
#include<set>
#include<queue>

typedef long long ll;
typedef unsigned long long ull;

const int MAX_N = 1000000;
ll mem[MAX_N];
int N;
int main() {

	int ret;
	cin >> N;
	mem[0] = 1;
	mem[1] = 1;
	rep(i, N+1){
		if (i >= 2) mem[i] = mem[i - 1] + mem[i - 2];
	}
	cout << mem[N] << endl;
}

C++: #include<stdio.h>
using namespace std;

int f[50]={1,1};

void Fibonacci(){
    for(int i=2;i<45;i++) f[i]=f[i-1]+f[i-2];
}

int main(){
    Fibonacci();
    int n;
    scanf("%d",&n);
    printf("%d\n",f[n]);
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define rep2(i,x,n) for(int i=x; i<(n); i++)
#define ALL(n) begin(n),end(n)
#define INF ((1<<30)-1)
#define LINF (1LL<<60)
#define EPS (1e-10)
typedef long long Int;
typedef pair<Int, Int> P;
typedef pair<int, int> pint;
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n; cin>>n;
    vector<Int> dp(n+1,0);
    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 <iostream>
#include <iomanip>
#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <functional>
#include <sstream>
#include <string>
#include <utility>
#include <map>
#include <memory>
#include <set>
#include <vector>
#include <deque>
#include <list>
#include <stack>
#include <queue>
#include <array>

using namespace std;

class Fibonacci
{
public:
  array<int,45> f;
  int fib( int n );
  int init();
};

int Fibonacci::init()
{
  for ( auto& i : f )
    i = -1;

  f[0] = 1;
  f[1] = 1;

  return 0;
}

int Fibonacci::fib( int n )
{
  if ( f[n] > 0 )
    return f[n];

  int ret = fib( n - 1 ) + fib( n - 2 );
  f[n] = ret;

  return ret;
}

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

  Fibonacci f;

  f.init();
  cout << f.fib( n ) << endl;

  return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cctype>
#include <climits>
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <list>
#include <queue>
#include <deque>
#include <algorithm>
#include <numeric>
#include <utility>
#include <complex>
#include <memory>
#include <functional>
 
using namespace std;
 
#define ALL(g) (g).begin(),(g).end()
#define REP(i, x, n) for(int i = x; i <= n; i++) //変数,初期値,終値
#define rep(i,n) REP(i,0,n)
#define F(i,j,k) fill(i[0],i[0]+j*j,k)
#define P(p) cout<<(p)<<endl;
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define INF 1<<25
#define pb push_back
 
typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<double> vd;
typedef pair<int,int> pii;
typedef pair<long,long> pll;
typedef long long ll;

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