dp = []
30.times do |i|
	i += 1
	if i == 1
		dp[i] = 1
	elsif i == 2
		dp[i] = 2
	elsif i == 3
		dp[i] = 4
	else
		dp[i] = dp[i - 1] + dp[i - 2] + dp[i - 3]
	end
end
until (n = gets.to_i) == 0
	p (dp[n] / 10.0 / 365.0).ceil.to_i
end