from math import factorial as fac



S = int(eval(input()))

ans = 0



if S == 1 or S == 2:

  print((0))

elif S == 3:

  print((1))

else:

  for k in range(1,S):

    if S-2*k-1 >= 0 and S-3*k >= 0:

      ans += fac(S-2*k-1)//(fac(k-1)*fac(S-3*k))

  print((ans%1000000007))
S = int(eval(input()))



if S == 1 or S ==2:

  print((0))

elif S == 3 or S == 4 or S == 5:

  print((1))

else:

  #初期化

  dp = [0]*S

  dp[2] = 1

  dp[3] = 1

  dp[4] = 1

  dp_S = 0

  #dp

  for i in range(5,S):

    dp_S += dp[i-3] 

    dp[i] = 1+dp_S



  print((dp[S-1]%1000000007))
from math import factorial as fac

S = int(eval(input()))
ans = 0
if S == 1 or S == 2:
    print((0))
elif S == 3:
    print((1))
else:
    for k in range(1, S):
        if S - 2 * k - 1 >= 0 and S - 3 * k >= 0:
            ans += fac(S - 2 * k - 1) // (fac(k - 1) * fac(S - 3 * k))
    print((ans % 1000000007))

S = int(eval(input()))
if S == 1 or S == 2:
    print((0))
elif S == 3 or S == 4 or S == 5:
    print((1))
else:
    # 初期化
    dp = [0] * S
    dp[2] = 1
    dp[3] = 1
    dp[4] = 1
    dp_S = 0
    # dp
    for i in range(5, S):
        dp_S += dp[i - 3]
        dp[i] = 1 + dp_S
    print((dp[S - 1] % 1000000007))

-from math import factorial as fac - -ans = 0 -elif S == 3: +elif S == 3 or S == 4 or S == 5: -    for k in range(1, S): -        if S - 2 * k - 1 >= 0 and S - 3 * k >= 0: -            ans += fac(S - 2 * k - 1) // (fac(k - 1) * fac(S - 3 * k)) -    print((ans % 1000000007)) +    # 初期化 +    dp = [0] * S +    dp[2] = 1 +    dp[3] = 1 +    dp[4] = 1 +    dp_S = 0 +    # dp +    for i in range(5, S): +        dp_S += dp[i - 3] +        dp[i] = 1 + dp_S +    print((dp[S - 1] % 1000000007))