$dp = Array.new(30) {Array.new(3)}
$dp[0] = [1,0,0]
$count = 0
def moveDp position
  until $count >= position
    $count += 1
    $dp[$count][0] = $dp[$count-1].inject(:+) 
    $dp[$count][1] = $dp[$count-1][0] 
    $dp[$count][2] = $dp[$count-1][1] 
  end
  return $dp[position].inject(:+)
end
until 0 == a = gets.to_i
  puts moveDp(a-1) / 3650 + 1
end