import sys input = sys.stdin.readline mod=10**9+7 N=int(input()) DPA=[0]*(N+100) DPB=[0]*(N+100) DPC=[0]*(N+100) DPA[1]=1 DPB[2]=1 DPC[3]=1 for i in range(N): DPA[i]%=mod DPB[i]%=mod DPC[i]%=mod DPB[i+2]+=DPA[i] DPC[i+3]+=DPA[i] DPA[i+1]+=DPB[i] DPC[i+3]+=DPB[i] DPA[i+1]+=DPC[i] DPB[i+2]+=DPC[i] print((DPA[N]+DPB[N]+DPC[N])%mod)