def rec(n, current)
  if @dp[current] != -1
    return @dp[current]
  end

  if current == n
    1
  elsif current > n
    0
  else
    @dp[current] = rec(n, current + 1) + rec(n, current + 2) + rec(n, current + 3)
  end
end

def solve(n)
  @dp = Array.new(34, -1)
  sum = rec(n, 0)
  result = ( (sum / 10) + 365 ) / 365
end

def main
  STDIN.each_line{|line|
    n = line.to_i
    puts solve n
    if n == 0
      break
    end
  }
end

main