while (n = gets.to_i) > 0
  dp = Array.new(n+1,0)
  dp[0] = 1
  
  for i in 0..(n-1)
    for j in 0..2
      if i+j+1 <= n
        dp[i+j+1] += dp[i]
      end
    end
  end
  
  puts ((dp[n]+9)/10 + 364) / 365
end
