def countWays(n):
    if n < 0:
        return 0
    elif n == 0:
        return 1
    else:
        return countWays(n - 1) + countWays(n - 2) + countWays(n - 3)


n = int(input())
print(countWays(n))

e463e7f57d7960951ed2037f6b6b6b547f721a09
<mask token>

def countWays(n):
    if n < 0:
        return 0
    elif n == 0:
        return 1
    else:
        return countWays(n - 1) + countWays(n - 2) + countWays(n - 3)


<mask token>

def countWays(n):
    if n < 0:
        return 0
    elif n == 0:
        return 1
    else:
        return countWays(n - 1) + countWays(n - 2) + countWays(n - 3)


<mask token>
print(countWays(n))

def countWays(n):
    if n < 0:
        return 0
    elif n == 0:
        return 1
    else:
        return countWays(n - 1) + countWays(n - 2) + countWays(n - 3)


n = int(input())
print(countWays(n))
