import scala.io.StdIn.readInt
import scala.collection.mutable.ArrayBuffer

object Main {

  def main(args:Array[String]) = {
    val b = new ArrayBuffer[Int]

    Iterator.continually(readInt).takeWhile(_!=0).foreach{ n =>

      def count(step:Int,total:Int):Int = {
        if(total>n) 0
        else if(total==n) 1
        else {
          count(1,total+1)+count(2,total+2)+count(3,total+3)
        }
      }
      val m = count(0,0)
      val p = m/3650; val q = if(m%3650==0) 0 else 1
      b += p + q
    }
    println(b.mkString("\n"))
  }
}