def resolve():

  base = 10**9+7

  S = int(eval(input()))

  dp = [0] * (S+1)

  dp[0] = 1



  for i in range(1, S+1):

    for u in range(i-2):

      dp[i] += dp[u]

      dp[i] %= base

  # print(dp)

  print((dp[S]%base))



if __name__ == "__main__":

  resolve()

def resolve():

  base = 10**9+7

  S = int(eval(input()))

  dp = [0] * (S+1)

  dp[0] = 1



  for i in range(3, S+1):

    dp[i] = dp[i-1] + dp[i-3]

  # print(dp)

  print((dp[S]%base))



if __name__ == "__main__":

  resolve()
def resolve():
    base = 10**9 + 7
    S = int(eval(input()))
    dp = [0] * (S + 1)
    dp[0] = 1
    for i in range(1, S + 1):
        for u in range(i - 2):
            dp[i] += dp[u]
            dp[i] %= base
    # print(dp)
    print((dp[S] % base))


if __name__ == "__main__":
    resolve()

def resolve():
    base = 10**9 + 7
    S = int(eval(input()))
    dp = [0] * (S + 1)
    dp[0] = 1
    for i in range(3, S + 1):
        dp[i] = dp[i - 1] + dp[i - 3]
    # print(dp)
    print((dp[S] % base))


if __name__ == "__main__":
    resolve()

-    for i in range(1, S + 1): -        for u in range(i - 2): -            dp[i] += dp[u] -            dp[i] %= base +    for i in range(3, S + 1): +        dp[i] = dp[i - 1] + dp[i - 3]