1 #include<bits/stdc++.h>
2 using namespace std;
3 const int maxn=1e6+5;
4 const int INF=1e9+7;
5 int n,f[60];
6 template <class t>void red(t &x)
7 {
8 x=0;
9 int w=1;
10 char ch=getchar();
11 while(ch<'0'||ch>'9')
12 {
13 if(ch=='-')
14 w=-1;
15 ch=getchar();
16 }
17 while(ch>='0'&&ch<='9')
18 {
19 x=(x<<3)+(x<<1)+ch-'0';
20 ch=getchar();
21 }
22 x*=w;
23 }
24 void input()
25 {
26 freopen("input.txt","r",stdin);
27 }
28 int main()
29 {
30 //input();
31 f[1]=1;
32 f[2]=2;
33 f[3]=3;
34 f[4]=4;
35 for(int i=5;i<=60;++i)
36 f[i]=f[i-1]+f[i-3];
37 while(scanf("%d",&n)==1&&n)
38 printf("%d
",f[n]);
39 return 0;
40 }