def solve(N):
    if N == 1:
        return 1
    a, b, c = 1, 1, 0
    mod = 10**9 + 7
    for n in range(N - 2):
        a, b, c = c, (a + c) % mod, b
    return (a + b + c) % mod

N = int(input())
print(solve(N))