#include<stdio.h>
#include<string.h>
int f[10010][600];
int main() {
int i,j,k,n,m;
memset(f,0,sizeof(f));
f[1][0]=1;f[2][0]=1;f[3][0]=1;f[4][0]=1;
for(i=5;i<=10000;i++) {
for(j=0;j<=550;j++) {
f[i][j]=f[i][j]+f[i-1][j]+f[i-2][j]+f[i-3][j]+f[i-4][j];
if(f[i][j]>=10000) {
f[i][j+1]+=f[i][j]/10000;
f[i][j]%=10000;
}
}
}
while(scanf("%d",&n)!=EOF) {
k=0;
for(i=550;i>=0;i--) {
if(k)
printf("%04d",f[n][i]);
else
if(f[n][i]) {
k=1;
printf("%d",f[n][i]);
}
}
printf("
");
}
return 0;
}