import java.io.*;
import java.math.BigInteger;

import static java.math.BigInteger.*;

import java.io.*;
import java.util.*;

public class fibstring_nv_bigint {
	public static void main(String[] args) {
		new fibstring_nv_bigint().run();
	}

	BufferedReader br;
	PrintWriter out;

	static class Matrix {
		final BigInteger a, b, c, d;

		Matrix() {
			this.a = BigInteger.ONE;
			this.b = BigInteger.ONE;
			this.c = BigInteger.ONE;
			this.d = BigInteger.ZERO;
		}

		Matrix(BigInteger a, BigInteger b, BigInteger c, BigInteger d) {
			this.a = a;
			this.b = b;
			this.c = c;
			this.d = d;
		}

		Matrix multiply(Matrix m) {
			BigInteger A = a.multiply(m.a).add(b.multiply(m.c));
			BigInteger B = a.multiply(m.b).add(b.multiply(m.d));
			BigInteger D = c.multiply(m.b).add(d.multiply(m.d));
			return new Matrix(A, B, B, D);
		}

		Matrix power(int n) {
			if (n < 2)
				return this;
			else if (n % 2 == 0) {
				Matrix m = power(n / 2);
				return m.multiply(m);
			} else {
				return multiply(power(n - 1));
			}
		}
	}

	public void solve() throws IOException {
		int n = Integer.parseInt(br.readLine());
		if (n < 3) {
			out.println("1");
			return;
		}
		if (n < 5) {
			out.println(n);
			return;
		}
		Matrix f = new Matrix();
		f = f.power(n);
		BigInteger ans = f.a.subtract(BigInteger.valueOf(2)); 
		out.println(ans.toString());
		return;
	}

	public void run() {
		try {
			br = new BufferedReader(new FileReader("fibstring.in"));
			out = new PrintWriter("fibstring.out");
			solve();
			out.close();
		} catch (IOException e) {
			e.printStackTrace();
			System.exit(1);
		}
	}
}