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 <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;

#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i, s, n) for(int i = s, i##_len=(n); i < i##_len; ++i)
#define FORS(i, s, n) for(int i = s, i##_len=(n); i <= i##_len; ++i)
#define VFOR(i, s, n) for(int i = s; i < (n); ++i)
#define VFORS(i, s, n) for(int i = s; i <= (n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define REPS(i, n) FORS(i, 0, n)
#define VREP(i, n) VFOR(i, 0, n)
#define VREPS(i, n) VFORS(i, 0, n)
#define RFOR(i, s, n) for(int i = s, i##_len=(n); i >= i##_len; --i)
#define RFORS(i, s, n) for(int i = s, i##_len=(n); i > i##_len; --i)
#define RREP(i, n) RFOR(i, n, 0)
#define RREPS(i, n) RFORS(i, n, 0)
#define ALL(v) (v).begin(), (v).end()
#define SORT(v) sort(ALL(v))
#define RSORT(v) sort(ALL(v), greater<decltype(v[0])>())
#define SZ(x) ((int)(x).size())
#define PB push_back
#define MP make_pair
#define MT make_tuple
#define BIT(n) (1LL<<(n))
#define UNIQUE(v) v.erase(unique(ALL(v)), v.end());

using ll = long long;
using PII = pair<int, int>;
using VI = vector<int>;
using VD = vector<double>;
using VLL = vector<ll>;
using VS = vector<string>;

const int MOD = 1000000007;
const int INF = 1000000000;

template<class T> bool chmax(T &a, const T &b){
    if(a < b){
        a = b; return true;
    }
    return false;
}
template<class T> bool chmin(T &a, const T &b){
    if(b < a){
        a = b; return true;
    }
    return false;
}



template <class T>
class Matrix{
private:
    vector<vector<T>> A;
public:
    Matrix(){}

    Matrix(size_t m, size_t n): A(m, vector<T>(n, 0)) {}

    Matrix(size_t n): A(n, vector<T>(n, 0)) {}

    Matrix(size_t m, size_t n, T a): A(m, vector<T>(n, a)) {}

    Matrix(const Matrix& mat){if(this != &mat) A = mat.A;}

    Matrix(vector<vector<T>> v){
        size_t m = v.size();
        assert(m != 0);
        size_t  n = v[0].size();
        REP(i, m) assert(v[i].size() == n);
        A = v;
    }

    ~Matrix() {}

    size_t height() const{return A.size();}

    size_t width() const{return A[0].size();}

    bool sameSize(const Matrix& mat) const{
        return height() == mat.height() && width() == mat.width();
    }

    inline const vector<T> &operator[](int idx) const{return A.at(idx);}

    inline vector<T> &operator[](int k){return (A.at(k));}

    void print2D(int w){
        size_t m = height(), n = width();
        REP(i, m){
            REP(j, n){
                if(j) cout << " ";
                cout << setw(w) << (*this)[i][j];
            }
            cout << "\n";
        }
    }

    friend ostream& operator<<(ostream &os, const Matrix &mat){
        size_t m = mat.height(), n = mat.width();
        REP(i, m){
            REP(j, n){
                if(j) os << " ";
                os << mat[i][j];
            }
            os << "\n";
        }
        return (os);
    }

    static Matrix identity(size_t n){
        Matrix ret(n);
        REP(i, n) ret[i][i] = 1;
        return ret;
    }

    Matrix operator+() const{return *this;}

    Matrix operator-() const{
        size_t m = height(), n = width();
        Matrix temp(height(), width());
        REP(i, m) REP(j, n) temp[i][j] = -(*this)[i][j];
        return temp;
    }

    Matrix& operator=(const Matrix mat){
        if(this != &mat){
            A = mat.A;
        }
        return *this;
    }

    Matrix& operator+=(const Matrix &B){
        size_t m = height(), n = width();
        assert(m == B.height() && n == B.width());
        REP(i, m) REP(j, n) (*this)[i][j] += B[i][j];
        return *this;
    }

    Matrix& operator-=(const Matrix &B){
        size_t m = height(), n = width();
        assert(m == B.height() && n == B.width());
        REP(i, m) REP(j, n) (*this)[i][j] -= B[i][j];
        return *this;
    }

    Matrix& operator*=(const Matrix &B){
        size_t m = height(), n = width(), l = B.width();
        assert(n == B.height());
        vector<vector<T>> C(m, vector<T>(l, 0));
        REP(i, m) REP(j, l) REP(k, n)
            C[i][j] = (C[i][j] + (*this)[i][k] * B[k][j]);
        A.swap(C);
        return *this;
    }

    Matrix& operator%=(const ll &mod){
        size_t m = height(), n = width();
        REP(i, m) REP(j, n) (*this)[i][j] %= mod;
        return *this;
    }

    Matrix operator+(const Matrix& mat) const{
        Matrix temp(*this);
        return temp += mat;
    }

    Matrix operator-(const Matrix& mat) const{
        Matrix temp(*this);
        return temp -= mat;
    }

    Matrix operator*(const Matrix& mat) const{
        Matrix temp(*this);
        return temp *= mat;
    }

    Matrix operator%(const ll mod) const{
        Matrix temp(*this);
        return temp %= mod;
    }

    bool operator==(const Matrix& mat) const{
        if(!sameSize(mat)) return false;
        size_t m = height(), n = width();
        REP(i, m) REP(j, n) if((*this)[i][j] != mat[i][j]) return false;
        return true;
    }

    bool operator!=(const Matrix& mat) const{return !(*this == mat);}
    
    Matrix powWithoutMod(ll b){
        size_t n = height();
        assert(n == width());
        Matrix ret = identity(n);
        Matrix a = *this;
        while(b){
            if(b & 1) ret = ret * a;
            a = a * a;
            b /= 2;
        }
        return ret;
    }

    Matrix pow(ll b, ll mod){
        size_t n = height();
        assert(n == width());
        Matrix ret = identity(n);
        Matrix a = *this;
        while(b){
            if(b & 1) ret = (ret * a) % mod;
            a = (a * a) % mod;
            b /= 2;
        }
        return ret;
    }

    Matrix pow(ll b) {
        return pow(b, MOD);
    }
};

ll fibonacci(int n){
    if(!n) return 1;
    vector<ll> a1{1, 1}, a2{1, 0};
    vector<vector<ll>> a{a1, a2};
    Matrix<ll> mat(a);
    mat = mat.powWithoutMod(n-1);
    return mat[0][0] + mat[0][1];
}

int main(){
    int n; cin >> n;
    cout << fibonacci(n) << "\n";
    return 0;
}