#region Header #!/usr/bin/env python3 # from typing import * import sys import io import math import collections import decimal import itertools from queue import PriorityQueue import bisect import heapq def input(): return sys.stdin.readline()[:-1] sys.setrecursionlimit(1000000) #endregion # _INPUT = """100 # """ # sys.stdin = io.StringIO(_INPUT) MOD = 1000000007 def main(): N = int(input()) dp = [[0, 0, 0] for _ in range(max(N+1, 5))] dp[0][0] = 1 dp[0][1] = 0 dp[0][2] = 0 dp[1][0] = 1 dp[1][1] = 0 dp[1][2] = 0 dp[2][0] = 0 dp[2][1] = 1 dp[2][2] = 0 dp[3][0] = 1 dp[3][1] = 1 dp[3][2] = 1 for i in range(4, N+1): dp[i][0] = (dp[i-1][1] + dp[i-1][2]) % MOD dp[i][1] = (dp[i-2][0] + dp[i-2][2]) % MOD dp[i][2] = (dp[i-3][0] + dp[i-3][1]) % MOD print(sum(dp[N]) % MOD) if __name__ == '__main__': main()