import std.stdio;
import std.conv;
import std.string;
import std.math;

int main(char[][] arg){

	char[] temp;
  	int[100] n;
	int num;
  	float print;

	for(int i=0; ; i++){
      
  	  temp = readln().dup;
      temp = chomp(temp.idup).dup;
      n[i] = to!(int)(temp.idup);
      if(n[i] == 0){
		num = i;
        break;
      }
      
    }
  
	int[100] a;

	a[0] = a[1] = 1;
  	a[2] = a[0] +a[1];
  
  for(int i=3; i<100; i++){
    a[i] = a[i-1] +a[i-2] +a[i-3];
  }

  for(int i=0; i<=num-1; i++){
  	print = a[ n[i] ]/10.0/365.0;
    print = ceil(print);
  	writefln("%d", cast(int)print);
  }
  
	return 0;
}