n = gets.to_i
until n == 0
    kaidan = []
    kaidan[1] = 1
    kaidan[2] = 2
    kaidan[3] = 4
    ans = 0
    if n > 3
    for i in 4..n do
        kaidan[i] = kaidan[i-1] + kaidan[i-2] + kaidan[i-3]
    end
    end
    if kaidan[n] % 3650 == 0
        puts kaidan[n] / 3650
    else
        a = (kaidan[n] / 3650)
        puts a + 1
    end
    n = gets.to_i
end
