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