#include #include #include using namespace std; using namespace atcoder; #define rep(i, l, n) for (int i = (l); i < (n); i++) #define ite(i, a) for(auto& i : a) #define all(x) x.begin(), x.end() #define lb lower_bound #define ub upper_bound #define lbi(A, x) (ll)(lb(all(A), x) - A.begin()) #define ubi(A, x) (ll)(ub(all(A), x) - A.begin()) using ll = long long; using Pair = pair; template using V = vector; template using VV = V >; const ll INF = 1000000000000000001; const int inf = 1001001001; const ll mod = 1000000007; const ll MOD = 998244353; template inline V getList(int n) { V res(n); rep(i, 0, n) { cin >> res[i]; }return res; } template inline VV getGrid(int m, int n) { VV res(m, V(n)); rep(i, 0, m) { res[i] = getList(n); }return res; } inline V dtois(string& s) { V vec = {}; for (auto& e : s) { vec.push_back(e - '0'); } return vec; } ll powmod(ll a, ll n) { ll res = 1; while (n) { if (n & 1) { res *= a; res %= mod; } n >>= 1; a *= a; a %= mod; } return res; } int main(void) { ll n; cin >> n; if (n <= 3) { cout << 0 << endl; return 0; } V dp(16, 1); dp[10] = 0; rep(i, 4, n) { V ndp(16); rep(j, 0, 16) { int t = j >> 1; ndp[j] = (dp[t] + dp[t + 8]) % mod; } ndp[10] = 0; dp = ndp; } ll ans = powmod(2, n); ite(i, dp) { ans += mod - i; ans %= mod; } cout << ans << endl; return 0; }