N=int(input()) mod=10**9+7 DP=[1,0,0] for i in range(N-1): x,y,z=DP DP=[z,x,(x+y)%mod] print(sum(DP)%mod)