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;

#define INF -1

int dp[45];

int main()
{
	for(int i = 0; i < 45; i++) { dp[i] = INF; }

	int n;

	cin >> n;

	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<bits/stdc++.h>
using namespace std;
int main(){
  int n,d[50];
  d[0]=d[1]=1;
  for(int i=0;i<43;i++)d[i+2]=d[i]+d[i+1];
  cin>>n;
  cout<<d[n]<<endl;
  return 0;
}

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

#define rep(i, m, n) for(int(i) = (int)(m); i < (int)(n); ++i)
#define rep2(i, m, n) for(int(i) = (int)(n)-1; i >= (int)(m); --i)
#define REP(i, n) rep(i, 0, n)
#define REP2(i, n) rep2(i, 0, n)
#define all(hoge) (hoge).begin(), (hoge).end()
#define en '\n'
using ll = long long;
using ull = unsigned long long;
using ld = long double;
template <class T>
using vec = vector<T>;
template <class T>
using vvec = vector<vec<T>>;
typedef pair<ll, ll> P;
constexpr long long INF = 1LL << 60;
constexpr int INF_INT = 1 << 25;
constexpr long long MOD = (ll)1e9 + 7;
//constexpr long long MOD = 998244353LL;
using ld = long double;
static const ld pi = 3.141592653589793L;
typedef vector<ll> Array;
typedef vector<Array> Matrix;

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

struct Edge {
    ll to, rev;
    long double cap;
    Edge(ll _to, long double _cap, ll _rev) {
        to = _to;
        cap = _cap;
        rev = _rev;
    }
};
using Edges = vector<Edge>;
using Graph = vector<Edges>;

void add_edge(Graph &G, ll from, ll to, long double cap, bool revFlag,
              long double revCap) {
    G[from].push_back(Edge(to, cap, (ll)G[to].size()));
    if(revFlag)
        G[to].push_back(Edge(from, revCap, (ll)G[from].size() - 1));
}

ll dp[50];

ll f(ll x) {
    if(x < 2)
        return 1;
    if(dp[x])
        return dp[x];
    return dp[x] = f(x - 1) + f(x - 2);
}

void solve() {
    ll n;
    cin >> n;
    cout << f(n) << en;
}

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

    solve();

    /*
    ll t;
    cin >> t;
    REP(i, t) { solve();}
    */

    return 0;
}

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

int main() {
	int n;
	int i;
	vector<long long> fib;
	scanf("%d",&n);
	fib.resize(n);
	fib[0]=fib[1]=1;
	for(i=2; i<n; ++i) {
		fib[i]=fib[i-1]+fib[i-2];
	}
	printf("%lld\n",fib[n-1]);
	return 0;
}

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

void Fibonachi(int F[], int n) {
	F[0] = F[1] = 1;
	for (int i = 2; i <= n; i++) {
		F[i] = F[i - 2] + F[i - 1];
	}
}

int main() {
	int n,F[MAX];
	cin >> n;
	Fibonachi(F,n);
	cout << F[n] << endl;
	return 0;
}

C++: #include<cstdio>
#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<functional>
#include<queue>
#include<math.h>
#define INF 999999

using namespace std;

int memo[50];

int fib(int n)
{
	memo[0] = 1;
	memo[1] = 1;

	if (n == 0)return 1;
	else if (n == 1)return 1;
	else {
		for (int i = 2; i <= n; i++) {
			memo[i] = memo[i - 1] + memo[i - 2];
		}
		return memo[n];
	}
}

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

	int ans = fib(n);
	cout << ans << endl;

	return 0;
}

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

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

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

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

vector<int> F;

int fibonacci(int N)
{
	F.push_back(1);
	F.push_back(1);
	for (int i = 2; i <= N; i++)
	{
		F.push_back(F[i - 2] + F[i - 1]);
	}
	return F[N];
}

int main(void)
{
	int N, ans;
	cin >> N;

	ans = fibonacci(N);

	cout << ans << endl;

	return 0;
}

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

#define MAX 50

using namespace std;

int m_fibo(int n){
    static int ans[MAX];
    if(n == 0 || n == 1) ans[n] = 1;
    if(ans[n] > 0) return ans[n];
    return ans[n] = m_fibo(n-1)+m_fibo(n-2);
}

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

C++: #include <cstdio>

int fibonacci(int* fib, int n){
    if(n<=1)return 1;
    if(fib[n]>0)return fib[n];
    fib[n] = fibonacci(fib, n-1) + fibonacci(fib, n-2);
    return fib[n];
}

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

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

int main(){
  int n;
  cin >> n;
  fill(memo,memo+50,-1);
  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>
#include <cstdio>
#include <cstdlib>
#include <time.h>
#include <math.h>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <iterator>
#include <sstream>
#include <string>
#include <bitset>
using namespace std;
#define FOR(I,F,N) for(int I = F; I < (int)(N); I++)
#define rep(i, n) FOR(i, 0, n)
#define FIN(V) cout<<V<<endl
#define pb push_back
#define INF (1 << 30)
typedef pair<int, int> P;
typedef long long ll;
typedef priority_queue<int> pq;
int StrToInt(string);
string IntToStr(int);
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, 1, -1};
int fib(int n){
	int dp[1000];
	fill_n(dp, 1000, 0);
	dp[0] = 1;
	dp[1] = 1;
	for(int i = 2; i < n; i++){
		dp[i] = dp[i-1] + dp[i-2];
	}
	return dp[n-1];
}

int main(void){
	int n;
	cin >> n;
	FIN(fib(n+1));
	return 0;
}