{-
URL: http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0168
?????????: Kannondou
??°?????£?????¨??????:???1??\???10???????????????????£???°???????????°??£???
-}
import Control.Applicative
import Control.Monad

main = do
 n <- fmap read getLine
 when (n>0) $ do
  print $ (f n + 3649) `div` 3650
  main

f :: Integer -> Integer
f 0 = 1
f 1 = f 0
f 2 = f 0 + f 1
f 18 = 35890
f 19 = 66012
f 20 = 121415
f n = f (n-1) + f (n-2) + f (n-3)