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 fib(int n);

int memo[45];
int main(){
  int n;
  cin >> n;
  cout << fib(n) << endl;
  retrun 0;
}

int bib(int n){

  if(n==0){
    return 1;
  }else if(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>
#include <unordered_map>
using namespace std;
int fib(int);
unordered_map<int, int> memoFib;

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

int fib(int n) {
  if(memoFib.count(n)) return memoFib[n];
  int a;
  a = memoFib[n] = n == 0 || n == 1 ? 1 : fib(n - 1) + fib(n - 2);
  return a;
}

C++: #define _USE_MATH_DEFINES
#include<iostream>
#include<algorithm>
#include<string>
#include<iomanip>
#include<cmath>
#include<vector>
#include<deque>
#include<queue>
#include<map>
#include<set>
#define ll long long
#define vll vector<ll>
#define dou(s) atof(s.c_str())
#define lon(s) atoll(s.c_str())
#define str(n) to_string(n)
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define rrep(i,b,a) for(ll i=b;i>=a;i--)
#define ALL(a) a.begin(),a.end()
#define rALL(a) a.rbegin(),a.rend()
#define line "\n"
#define mav(a) (*max_element(ALL(a)))
#define miv(a) (*min_element(ALL(a)))
#define vfind(a,n) (find(ALL(a),n)-a.begin())
#define prque priority_queue
#define MOD 1000000007ll
using namespace std;
void solve();
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	solve();
}

//nCk(mod p)
/*ll fac[510000], finv[510000], inv[510000];
void cmodf(ll p = MOD) {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	rep(i, 2, 510000) {
		fac[i] = fac[i - 1] * i%p;
		inv[i] = p - inv[p%i] * (p / i) % p;
		finv[i] = finv[i - 1] * inv[i] % p;
	}
}
ll cmod(ll n, ll k, ll p = MOD) {
	return fac[n] * (finv[k] * finv[n - k] % p) % p;
}*/

//最大公約数
ll gcd(ll n, ll m) {
	ll k = n % m;
	while (k != 0) { n = m; m = k; k = n % m; }
	return m;
}
ll gcd(vector<ll> a) {
	rep(i, 1, a.size()) {
		ll k = a[i - 1] % a[i];
		while (k != 0) {
			a[i - 1] = a[i];
			a[i] = k;
			k = a[i - 1] % a[i];
		}
	}
	return a.back();
}

//最小公倍数
ll lcm(ll n, ll m) {
	ll t = n * m, k = n % m;
	while (k != 0) { n = m; m = k; k = n % m; }
	return t / m;
}
ll lcm(vector<ll> a) {
	ll n;
	rep(i, 1, a.size()) {
		n = a[i - 1] * a[i];
		ll k = a[i - 1] % a[i];
		while (k != 0) {
			a[i - 1] = a[i];
			a[i] = k;
			k = a[i - 1] % a[i];
		}
		n /= a[i];
		a[i] = n;
	}
	return n;
}

//keyの小さい方から探していった時に初めてvalueがjoken以上になる時のkey（keyが増えたらvalueも増えるか同じになるとき）
ll value(ll key) {
	/*変更*/
	return 0;
}
ll mini(ll lkey, ll rkey/*ここも調べる*/, ll joken) {
	ll mkey;
	while (lkey != rkey) {
		mkey = (lkey + rkey) / 2;
		if (value(mkey) >= joken)rkey = mkey;
		else lkey = mkey + 1;
	}
	return rkey;
}

//ペア配列の整理
struct pea { ll n, m; };
void msort(vector<pea> &a, bool k = true) {
	struct hikakukansu {
		static bool unstable(const pea &x, const pea &y) { return x.m < y.m; }
		static bool stable(const pea &x, const pea &y) { return (x.m == y.m ? x.n < y.n : x.m < y.m); }
	};
	if (k)sort(ALL(a), hikakukansu::unstable);
	else sort(ALL(a), hikakukansu::stable);
}

//変数定義

//再帰関数

//アルゴリズム
void solve() {
	ll n; cin >> n;
	vll a(n+1,1);
	rep(i, 2, n+1)a[i] = a[i - 1] + a[i - 2];
	cout << a[n] << line;
}

C++: #include <iostream>

using namespace std;
int F[100];
int main() {
	int n;
	cin >> n;
	F[0] = 1;
	F[1] = 1;
	for (int i=2; i<=n; ++i) {
		F[i] = F[i-2] + F[i-1];
	}
	cout << F[n] << endl;
}

C++: #include<iostream>
#include<vector>
#define NIL -1
using namespace std;

int fib(vector<int>& F, int n){
    if (F[n] != NIL) return F[n];
    return F[n] = fib(F, n - 1) + fib(F, n - 2);
}

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

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

int main() {
    int n;
    cin >> n;
    int F[50];
    F[0] = 1;
    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<string>
using namespace std;

int fib(int n);

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

    return 0;
}

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

C++: #include<iostream>
#include<algorithm>


using namespace std;


int main()
{
	int n;
	int a[45] = { 1,1 };
	ios::sync_with_stdio(false);

	cin >> n;

	for (int i = 2; i < n+1; ++i)
	{
		a[i] = a[i - 1] + a[i - 2];
	}

	cout << a[n] << endl;

	return 0;

}

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

int FibonacciNumber(int n) {

	if (n <= 1) {
		return 1;
	}
	return FibonacciNumber(n - 1) + FibonacciNumber(n - 2);
}

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

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

C++: #include<cstdio>

const int maxn = 44 + 1;
int a[maxn];

int calcFibonacciNumber(int n) {
    if (n < 0) {
        return 0;
    }
    if (n == 0 || n == 1) {
        return 1;
    }
    if (a[n] != -1) {
        return a[n];
    }
    a[n] = calcFibonacciNumber(n - 1) + calcFibonacciNumber(n - 2);
    return a[n];
}

int getFibonacciNumber(int n) {
    return calcFibonacciNumber(n);
}

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

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

long long fibodp(int n){
    long long fibodp[200]={0};
    fibodp[0]=1;
    fibodp[1]=1;
    for(int i=2; i<=n; i++){
        fibodp[i]=fibodp[i-1]+fibodp[i-2];
    }
    return fibodp[n];
}

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