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