n = int(input()) a = 1 b = 0 c = 0 M = 10**9 + 7 for i in range(n-1): a, b, c = c, a, (a + b) % M result = (a + b + c) % M print(result)