#include<stdio.h>
#include<stdlib.h> //·¥´ý
#include<string>
#include<math.h>
#define INT long long int
using namespace std;
char in[100], out[100];

int n;
int f(int c, int m){
	if( c>0 and c%3==0) m++;
	if(c==n and m==1) return 1;
	if(c>=n) return 0;
	return f(c+1,m)+f(c+2,m)+f(c+3,m);
}
int main(){
	for(int I = 1; I<=15; I++){
		sprintf(in,".%d.in",I);
        freopen(in,"w",stdout);
        n = I;
		//scanf("%d", &n);
		printf("%d", n);
		sprintf(in,".%d.out",I);
        freopen(in,"w",stdout);
		printf("%d",f(0,0));
	}
}
