function main(input) {
  input=input.trim();
  const n = parseInt(input.split(" ")[0], 10);
  if(n==1){
    console.log(2);
  }else if(n==2){
    console.log(1);
  }else{
    var deff=[2,1]
    for(var i=2; i<=n; i++){
      deff.push(deff[i-1]+deff[i-2])
    }
    console.log(deff[n]);
  }

}



main(require('fs').readFileSync('/dev/stdin', 'utf8'));