#include<iostream>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<fstream>
#include<algorithm>
using namespace std;
char a[350][150];
const int maxx=150;
char * Add(char *s1,char *s2)
{
int a[maxx+10]={0},b[maxx+10]={0};
memset(a,0,sizeof(a));
memset(b,0,sizeof(b));
int l1=strlen(s1);
int l2=strlen(s2);
for (int i=l1-1,j=maxx;i>=0;i--,j--)
a[j]=s1[i]-'0';
for (int i=l2-1,j=maxx;i>=0;i--,j--)
b[j]=s2[i]-'0';
for (int i=maxx;i>=0;i--)
{
a[i]+=b[i];
if(a[i]>=10) a[i-1]+=a[i]/10,a[i]%=10;
}
char s3[maxx+10]; //把int数组转化为char数组,有时可以直接输出
memset(s3,0,sizeof(s3));
int temp=0;
int k=0;
for (int i=0;i<=maxx;i++)
{
if (a[i]!=0&&temp==0) temp=1;
if(temp==1) s3[k++]=a[i]+'0';
}
return s3;//返回局部变量的地址,警告
}
void init( )
{
strcpy(a[0],"1");
strcpy(a[1],"1");
strcpy(a[2],"3");
strcpy(a[3],"5");
for(int i=4;i<310;i++)
{
char b[150];
strcpy(b,Add(a[i-1],a[i-2]));
strcpy(a[i],Add(b,a[i-2]));
}
}
int main( )
{
//freopen("1.txt","r",stdin);
init( );
int n;
while(scanf("%d",&n)!=EOF)
{
printf("%s\n",a[n]);
}
return 0;
}
#include<cmath>
#include<cstring>
#include<cstdio>
#include<fstream>
#include<algorithm>
using namespace std;
char a[350][150];
const int maxx=150;
char * Add(char *s1,char *s2)
{
int a[maxx+10]={0},b[maxx+10]={0};
memset(a,0,sizeof(a));
memset(b,0,sizeof(b));
int l1=strlen(s1);
int l2=strlen(s2);
for (int i=l1-1,j=maxx;i>=0;i--,j--)
a[j]=s1[i]-'0';
for (int i=l2-1,j=maxx;i>=0;i--,j--)
b[j]=s2[i]-'0';
for (int i=maxx;i>=0;i--)
{
a[i]+=b[i];
if(a[i]>=10) a[i-1]+=a[i]/10,a[i]%=10;
}
char s3[maxx+10]; //把int数组转化为char数组,有时可以直接输出
memset(s3,0,sizeof(s3));
int temp=0;
int k=0;
for (int i=0;i<=maxx;i++)
{
if (a[i]!=0&&temp==0) temp=1;
if(temp==1) s3[k++]=a[i]+'0';
}
return s3;//返回局部变量的地址,警告
}
void init( )
{
strcpy(a[0],"1");
strcpy(a[1],"1");
strcpy(a[2],"3");
strcpy(a[3],"5");
for(int i=4;i<310;i++)
{
char b[150];
strcpy(b,Add(a[i-1],a[i-2]));
strcpy(a[i],Add(b,a[i-2]));
}
}
int main( )
{
//freopen("1.txt","r",stdin);
init( );
int n;
while(scanf("%d",&n)!=EOF)
{
printf("%s\n",a[n]);
}
return 0;
}