#include<iostream>
#include<vector>
#include<string>
using namespace std;
class num {
private:
vector<long long> n;
const static int MAX = (int)1e9;
const static int MAXLEN = 9;
public:
num() {}
num(long long _n) { if(!_n) n.push_back(0); while(_n) { n.push_back(_n%MAX); _n/=MAX; }
}
~num() { n.clear(); }
const num operator+ (const num& op) const {
num res;
int size = n.size(), sizeOP = op.n.size();
int N = size > sizeOP ? size : sizeOP;
int carry = 0;
for(int i=0; i<N; i++) {
int a = (i<size?n[i]:0) + (i<sizeOP?op.n[i]:0) + carry;
if(a >= MAX) { carry = 1; a -= MAX; }
else carry = 0;
res.n.push_back(a);
}
if(carry) res.n.push_back(carry);
return res;
}
const num operator* (const num& op) const {
num res;
int size = n.size(), sizeOP = op.n.size();
const num& b = (size < sizeOP ? op : *this);
const num& s = (size < sizeOP ? *this : op);
int bSize = size < sizeOP ? sizeOP : size;
int sSize = size < sizeOP ? size : sizeOP;
int resSize = bSize + sSize;
if(b.n[bSize-1]*s.n[sSize-1] < MAX) resSize--;
res.n.assign(resSize, 0);
int carry = 0;
for(int i=0; i<bSize; i++)
for(int j=0; j<sSize; j++) {
long long a = b.n[i] * s.n[j];
if(a >= MAX) { res.n[i+j+1] += a/MAX; a %= MAX; }
res.n[i+j] += a;
if(res.n[i+j]>=MAX) {
res.n[i+j+1] += res.n[i+j]/MAX;
res.n[i+j] %= MAX;
}
}
return res;
}
void prt() const {
int size = n.size();
cout << n[size-1];
for(int i=size-2; i>=0; i--) {
string s = to_string(n[i]);
int z = MAXLEN - s.size();
while(z--) cout << '0';
cout << s;
}
}
};
typedef vector<vector<num>> Matrix;
Matrix operator * (const Matrix& a, const Matrix& b) {
int size = a.size();
Matrix res(size, vector<num>(size,0));
for(int i=0; i<size; i++)
for(int j=0; j<size; j++)
for(int k=0; k<size; k++)
res[i][j] = res[i][j] + a[i][k] * b[k][j];
return res;
}
int main() {
ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
int n; cin >> n;
if(n<=1) { cout << n; return 0; }
Matrix ans = {{1,0},{0,1}};
Matrix I = {{1,1},{1,0}};
while(n) {
if(n&1) ans = ans * I;
I = I * I;
n/=2;
}
ans[0][1].prt();
// num a(1), ans(0), t;
// while(n--) {
// t = ans + a;
// ans = a;
// a = t;
// }
// ans.prt();
return 0;
}