N = int(input()) a = 1 b = 1 c = 0 a_tmp = 0 b_tmp = 0 c_tmp = 0 d = 0 if N == 1: print(1) elif N == 2: print(2) else: for i in range(N-2): a_tmp,b_tmp,c_tmp = a,b,c a = c_tmp % (10**9 + 7) b = (a_tmp % (10**9 + 7))+(c_tmp % (10**9 + 7)) c = (b_tmp % (10**9 + 7)) d = (a + b + c)%(10**9 + 7) print(d)