#include<stdio.h>
int main()
{
int ans[60]={0};
int i,x;
ans[1] = 1;
ans[2] = 2;
ans[3] = 3;
for(i = 4; i<56; ++i)
{ans[i] = ans[i-1] + ans[i-3];}
while (scanf("%d",&x)!=EOF)
if(x!=0)
printf("%d\n",ans[x]);
return 0;
}
#include<stdio.h>
int main()
{
int ans[60]={0};
int i,x;
ans[1] = 1;
ans[2] = 2;
ans[3] = 3;
for(i = 4; i<56; ++i)
{ans[i] = ans[i-1] + ans[i-3];}
while (scanf("%d",&x)!=EOF)
if(x!=0)
printf("%d\n",ans[x]);
return 0;
}