#include<stdio.h>
int main(){
int n;
int a,b,c,i,num;
while(~scanf("%d",&n)){
int a=1,b=1,c=1,num=0;
if(n<=3){
printf("1\n");
}
if(n>3) {
for(i=4;i<=n;i++){
num=a+c;
a=b;
b=c;
c=num;
}
printf("%d\n",num);
}
}
return 0;
}