function memoization(f) {
  const cache = {};
  return (...param) => {
    const c = cache[param];
    return typeof c === 'undefined' ? cache[param] = f(...param) : c;
  };
}

(function main() {
  const n = Number(require('fs').readFileSync('/dev/stdin', 'utf8'));
  const fib = memoization(function fib(n) {
    if (n === 0 || n === 1) return 1;
    return fib(n - 1) + fib(n - 2);
  });
  console.log(fib(n));
})();

