Go: package main

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

// I/O
type Scanner struct {
	sc *bufio.Scanner
}

func NewScanner() *Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024), int(1e+9))
	return &Scanner{sc}
}

func (s *Scanner) nextStr() string {
	s.sc.Scan()
	return s.sc.Text()
}

func (s *Scanner) nextInt() int {
	i, e := strconv.Atoi(s.nextStr())
	if e != nil {
		panic(e)
	}
	return i
}

func (s *Scanner) nextFloat() float64 {
	f, e := strconv.ParseFloat(s.nextStr(), 64)
	if e != nil {
		panic(e)
	}
	return f
}

func (s *Scanner) nextRuneSlice() []rune {
	return []rune(s.nextStr())
}

func (s *Scanner) nextIntSlice(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextInt()
	}
	return res
}

func (s *Scanner) nextFloatSlice(n int) []float64 {
	res := make([]float64, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextFloat()
	}
	return res
}

// Arithmetic
func max(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m < i {
			m = i
		}
	}
	return m
}

func min(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m > i {
			m = i
		}
	}
	return m
}

func abs(x int) int {
	if x > 0 {
		return x
	}
	return -x
}

func pow(x, y int) int {
	res := 1
	for i := 0; i < y; i++ {
		res *= x
	}
	return res
}

func ceil(a, b int) int {
	if a%b == 0 {
		return a / b
	} else {
		return a/b + 1
	}
}

// Sort
type RuneSlice []rune

func (a RuneSlice) Len() int           { return len(a) }
func (a RuneSlice) Less(i, j int) bool { return a[i] < a[j] }
func (a RuneSlice) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }

// Main
func main() {
	sc := NewScanner()
	wtr := bufio.NewWriter(os.Stdout)
	N := sc.nextInt()
	dp := make([]int, N+1)
	dp[0] = 1
	dp[1] = 1
	for i := 2; i <= N; i++ {
		dp[i] = dp[i-1] + dp[i-2]
	}

	fmt.Fprintln(wtr, dp[N])
	wtr.Flush()
}

C++: #include <iostream>
using namespace std;
int dp[50];
int fib(int n){
        if(n<2)
                return 1;
        if(dp[n]!=-1)return dp[n];
        return dp[n]=fib(n-1)+fib(n-2);
}
int main(){
        int N;
        for(int i=0 ; i<50 ; i++ )
                dp[i]=-1;
        cin >> N;
        cout << fib(N) << endl;
        return 0;
}

C++: #include<cstdio>
#include<iostream>
using namespace std;
int main()
{
  int n;
  scanf("%d", &n);
  int A[50];
  A[0] = A[1] = 1;
  for(int i=2; i<=n; i++)
  {
    A[i] = A[i-1] + A[i-2];
  }
  printf("%d\n", A[n]);//dynamic programing;


  return 0;
}

C++: #include "bits/stdc++.h"

#define REP(i,num) for(ll i=0;i<(num);++i)
#define LOOP(i) while(i--)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto pitr=c.begin();pitr!=c.end();++pitr){cout<<*pitr;if(next(pitr,1)!=c.end())cout<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=ll>
T in(){T x; cin >> x; return (x);}
template<typename T=ll,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

vll F;
ll Fib(ll n){
	if(F[n]>0) return F[n];
	return F[n]=Fib(n-1)+Fib(n-2);
}

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

	int N=in();
	F.resize(50,-1);
	F[0]=F[1]=1;

	out(Fib(N));
	return 0;
}

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

C++: #include <iostream>

#define N 50

int dp[N];

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

int main() {
    int n;
    std::cin>>n;
    std::cout << fibonacci(n) << std::endl;
}

C++: #include <iostream>

using namespace std;

int A[128];
int fib(int n){
  A[0] =1;
  A[1] =2
  for(int i=2;i<44;++i){
    A[i] =A[i-1];
    if(i>1)A[i]+=A[i-2];
  }
  return A[n-1];

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

C++: #include <bits/stdc++.h>
#include<math.h>
#include<algorithm> 
#define rep(i,n) for (int i = 0; i < (n) ; ++i)
using namespace std;
using ll = long long ;
using P = pair<int, int> ;
#define PI 3.14159265358979323846264338327950
#define INF 1e18

int dp [50] ;
int fib(int x){
    if(x == 1 || x == 0){
        return 1 ;
    }
    if(dp[x]>0){
        return dp[x] ;
    }
    dp[x] = fib(x-1) + fib(x-2) ;
    return fib(x-1) + fib(x-2) ;
}
int main() {
    int n ;
    cin >> n ;
    int ans = fib(n) ;
    cout << ans << endl ; 
}

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

typedef unsigned long long ull;
unsigned long long m[44]={0};


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

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

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

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

int fibonacci(int i) {
  if (MEM[i] != -1) return MEM[i];
  if (i == 0 || i == 1) return 1;
  MEM[i - 2] = fibonacci(i - 2);
  MEM[i - 1] = fibonacci(i - 1);
  return MEM[i - 2] + MEM[i - 1];
}

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

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

  int i;
  cin >> i;

  cout << fibonacci(i) << endl;

  return 0;
}

C++: #include <iostream>

using namespace std;

int main() {
    int n, dp[50];
    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++: #include <iostream>

using namespace std;

unsigned long long *cache;

unsigned long long fun(int n) {
	if (cache[n] == -1) {
		cache[n] = fun(n-1) + fun(n-2);
	}
	return cache[n];
}

int main() {
	int n;
	cin >> n;
	cache = new unsigned long long[n+2];
	cache[0] = cache[1] = 1;
	for (int i = 2;i<n+2;i++) {
		cache[i] = -1;
	}
	fun(n);
	cout << cache[n] << endl;
	return 0;

}

C++: #include <iostream>
#include <sstream>
#include <cstdio>
#include <stdlib.h>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int f[45];
int fib(int n){
  if(n==1||n==0)return 1;
  if(f[n]!=0)return f[n];
  else return f[n]=fib(n-1)+fib(n-2);
}
int main(){
  int  n;
  cin>>n;
  cout<<fib(n)<<endl;



  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define numrep(i,n) for(int i=1;i<=n;i++)
#define bitrep(n) for(int bit=0;bit<(1<<n);bit++)
#define ll int64_t
#define all(v) v.begin(), v.end()

int main() {

int n; cin>>n;

vector<ll> dp(45);
dp[0]=1;
dp[1]=1;

for(int i=2;i<45;i++) dp[i]=dp[i-1]+dp[i-2];

cout << dp[n] << endl;

return 0;
}

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 <iostream>
#include <cstring>
using namespace std;
typedef unsigned long long ull;

ull dp[100];

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

int main(void)
{
  int N;
  cin >> N;
  memset(dp, -1, sizeof(dp));
  cout << fib(N) << endl;
}