n=input()
a,b,c=1,0,0
for i in xrange(n):
    a,b,c=(b+c)%1000000007,a,b
print (a+b+c)%1000000007