MOD = int(1e9+7) def main(): N = int(input()) dp_table = [[0, 0, 0, 0] for _ in range(N+1)] dp_table[0][0] = 1 dp_table[0].append(sum(dp_table[0]) % MOD) for stair in range(1, N+1): for up_stair in range(1, min(stair+1, 4)): dp_table[stair][up_stair] = dp_table[stair-up_stair][4] - \ dp_table[stair-up_stair][up_stair] dp_table[stair].append(sum(dp_table[stair]) % MOD) print(dp_table[N][4]) if __name__ == "__main__": main()