N = int(input()) M = 10**9 + 7 k0, k1, k2 = [0, 1, 0] for _ in range(1, N): kk = (k1+k2) % M k2 = k1 k1 = k0 k0 = kk print((k0+k1+k2)%M)