# -*- coding: utf-8 -*-

"""

http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0168



"""

import sys

from sys import stdin

from math import ceil

input = stdin.readline





def solve(n):

    dp = [[0] * (n+1) for _ in range(n+1)]

    dp[0][0] = 1



    for i in range(1, n+1):

        for j in range(i, n+1):

            t = 0

            for k in range(1, min(j+1, 3+1)):

                t += dp[i-1][j-k]

            dp[i][j] = t



    total = 0

    for d in dp:

        total += d[-1]

    return total





def main(args):

    while True:

        n = int(eval(input()))

        if n == 0:

            break



        result = solve(n)

        print((ceil(result / 365 / 10)))





if __name__ == '__main__':

    main(sys.argv[1:])

    
# -*- coding: utf-8 -*-

"""

http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0168



"""

import sys

from sys import stdin

from math import ceil

input = stdin.readline



dp = 0

def solve(n):

    global dp

    dp = [[0] * (n+1) for _ in range(n+1)]

    dp[0][0] = 1



    for i in range(1, n+1):

        for j in range(i, n+1):

            t = 0

            for k in range(1, min(j+1, 3+1)):

                t += dp[i-1][j-k]

            dp[i][j] = t



    total = 0

    for d in dp:

        total += d[-1]

    return total





def main(args):

    while True:

        n = int(eval(input()))

        if n == 0:

            break



        result = solve(n)

        print((ceil(result / 365 / 10)))





if __name__ == '__main__':

    main(sys.argv[1:])

    
# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0168
"""
import sys
from sys import stdin
from math import ceil

input = stdin.readline


def solve(n):
    dp = [[0] * (n + 1) for _ in range(n + 1)]
    dp[0][0] = 1
    for i in range(1, n + 1):
        for j in range(i, n + 1):
            t = 0
            for k in range(1, min(j + 1, 3 + 1)):
                t += dp[i - 1][j - k]
            dp[i][j] = t
    total = 0
    for d in dp:
        total += d[-1]
    return total


def main(args):
    while True:
        n = int(eval(input()))
        if n == 0:
            break
        result = solve(n)
        print((ceil(result / 365 / 10)))


if __name__ == "__main__":
    main(sys.argv[1:])

# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0168
"""
import sys
from sys import stdin
from math import ceil

input = stdin.readline
dp = 0


def solve(n):
    global dp
    dp = [[0] * (n + 1) for _ in range(n + 1)]
    dp[0][0] = 1
    for i in range(1, n + 1):
        for j in range(i, n + 1):
            t = 0
            for k in range(1, min(j + 1, 3 + 1)):
                t += dp[i - 1][j - k]
            dp[i][j] = t
    total = 0
    for d in dp:
        total += d[-1]
    return total


def main(args):
    while True:
        n = int(eval(input()))
        if n == 0:
            break
        result = solve(n)
        print((ceil(result / 365 / 10)))


if __name__ == "__main__":
    main(sys.argv[1:])

+dp = 0 +    global dp