N = int(eval(input()))



if N <= 2:

    print((0))

    exit()

if N <= 5:

    print((1))

    exit()



A = [1,1,1]

for i in range(N - 5):

    A += A[i] + A[i+2],

ans = A[N-6] + A[N-4]

ans %= 10**9 + 7

print(ans)
N = int(eval(input()))



if N <= 5:

    print((N//3))

    exit()

    

A = [1,1,1]

for i in range(N - 5):

    A += A[i] + A[i+2],

print((A.pop()%(10**9+7)))
N = int(eval(input()))
if N <= 2:
    print((0))
    exit()
if N <= 5:
    print((1))
    exit()
A = [1, 1, 1]
for i in range(N - 5):
    A += (A[i] + A[i + 2],)
ans = A[N - 6] + A[N - 4]
ans %= 10**9 + 7
print(ans)

N = int(eval(input()))
if N <= 5:
    print((N // 3))
    exit()
A = [1, 1, 1]
for i in range(N - 5):
    A += (A[i] + A[i + 2],)
print((A.pop() % (10**9 + 7)))

-if N <= 2: -    print((0)) -    exit() -    print((1)) +    print((N // 3)) -ans = A[N - 6] + A[N - 4] -ans %= 10**9 + 7 -print(ans) +print((A.pop() % (10**9 + 7)))