from functools import lru_cache

import sys



sys.setrecursionlimit(2000)

mod = 10 ** 9 + 7



@lru_cache(maxsize=None)

def dp(i):

    if i == 1 or i == 2:

        return 0

    elif i == 3 or i == 4:

        return 1

    else:

        return (dp(i - 3) + dp(i - 1)) % mod





S = int(eval(input()))

print((dp(S)))

S = int(eval(input()))

if S == 1 or S == 2:

    print((0))



elif S == 3:

    print((1))



else:

    mod = 10 ** 9 + 7

    dp = [0 for _ in range(S)]

    dp[0] = dp[1] = 0

    dp[2] = dp[3] = 1



    for i in range(3, S):

        dp[i] = (dp[i - 3] + dp[i - 1]) % mod



    print((dp[-1]))
from functools import lru_cache
import sys

sys.setrecursionlimit(2000)
mod = 10**9 + 7


@lru_cache(maxsize=None)
def dp(i):
    if i == 1 or i == 2:
        return 0
    elif i == 3 or i == 4:
        return 1
    else:
        return (dp(i - 3) + dp(i - 1)) % mod


S = int(eval(input()))
print((dp(S)))

S = int(eval(input()))
if S == 1 or S == 2:
    print((0))
elif S == 3:
    print((1))
else:
    mod = 10**9 + 7
    dp = [0 for _ in range(S)]
    dp[0] = dp[1] = 0
    dp[2] = dp[3] = 1
    for i in range(3, S):
        dp[i] = (dp[i - 3] + dp[i - 1]) % mod
    print((dp[-1]))

-from functools import lru_cache -import sys - -sys.setrecursionlimit(2000) -mod = 10**9 + 7 - - -@lru_cache(maxsize=None) -def dp(i): -    if i == 1 or i == 2: -        return 0 -    elif i == 3 or i == 4: -        return 1 -    else: -        return (dp(i - 3) + dp(i - 1)) % mod - - -print((dp(S))) +if S == 1 or S == 2: +    print((0)) +elif S == 3: +    print((1)) +else: +    mod = 10**9 + 7 +    dp = [0 for _ in range(S)] +    dp[0] = dp[1] = 0 +    dp[2] = dp[3] = 1 +    for i in range(3, S): +        dp[i] = (dp[i - 3] + dp[i - 1]) % mod +    print((dp[-1]))