n = int(raw_input()) p = (1,0,0) for _ in range(n-1): q = (p[2], p[0], p[0]+p[1]) p = q print sum(p) % (10**9 + 7)