#include<stdio.h>
__int64 a[55];
int main()
{
int n;int i;
while(scanf("%d",&n)!=EOF&&(n!=-1))
{
a[0]=0;a[1]=1;
for(i=2;i<=50;i++)
a[i]=a[i-1]+a[i-2];
printf("%I64d\n",a[n]);
}
return 0;
}
__int64 a[55];
int main()
{
int n;int i;
while(scanf("%d",&n)!=EOF&&(n!=-1))
{
a[0]=0;a[1]=1;
for(i=2;i<=50;i++)
a[i]=a[i-1]+a[i-2];
printf("%I64d\n",a[n]);
}
return 0;
}