package DTGH;
import java.util.Scanner;
/*
动态规划
假设你现在正在爬楼梯,楼梯有 n级。每次你只能爬 1级或者 2 级,那么你有多少种方法爬到楼梯的顶部?
*/
public class UpStairsPLT {
/*
思路:n层时会有n-1层上去或者n-2层上去 以此类推 最前面 f(2)=2; f(1)=1; f(3)=f(2)+f(1);
*/
public long res(int i){
long[] re=new long[i+1];
re[0]=0;
if (i>0) re[1]=1;
if (i>1) re[2]=2;
if (i>2) {
for (int j = 3; j <= i; j++) {
re[j] = re[j - 1] + re[j - 2];
}
}
/* if(i<=2){
if (i==1) {
return 1;
}else {
return 2;
}
}else {
return res(i-1)+res(i-2);
}*/
return re[i];
}
public static void main(String[] args) {
UpStairsPLT a=new UpStairsPLT();
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
System.out.println(a.res(n));
}
}