#include using namespace std ; #define pb(n) push_back(n) #define fi first #define se second #define all(r) (r).begin(),(r).end() #define vmax(ary) *max_element(all(ary)) #define vmin(ary) *min_element(all(ary)) #define debug(x) cout<<#x<<": "< name(size,init) #define vvl(v,w,h,init) vector> v(w,vector(h,init)) #define mp(a,b) make_pair(a,b) #define rep(i,n) for(int i = 0; i < (int)(n);++i) #define REP(i,a,b) for(int i = (a);i < (int)(b);++i) #define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it) #define repa(n,array) for(auto &n :(array)) using ll = long long; using pii = pair ; using pll = pair ; const int mod = 1000000007; constexpr int inf = ((1<<30)-1)*2+1 ; constexpr double PI = acos(-1.0) ; double eps = 1e-10 ; const int dy[] = {-1,0,1,0,1,-1,1,-1}; const int dx[] = {0,-1,0,1,1,-1,-1,1}; inline bool value(int x,int y,int w,int h){ return (x >= 0 && x < w && y >= 0 && y < h); } template void Unique(vector &v){ sort(all(v)); v.erase(unique(all(v)),v.end()); } template ll FindErase(T &v,U tar){ ll cnt = 0; for(auto it = v.begin(); it != v.end();){ if(*it == tar){ it = v.erase(it); ++cnt; } else{ ++it; } } return cnt; } template bool SuffixErase(T &v,size_t suf){ if(suf > v.size()) return false; for(auto it = v.begin(); it != v.end();){ if(distance(v.begin(),it) == suf){ v.erase(it); return true; } else{ ++it; } } return false; } template T ston(string& str, T n){ istringstream sin(str) ; T num ; sin >> num ; return num ; } // 0:PKP, 1:KKP, 2:KPK, 3:PKK ll dp[1000005][4]; int main(){ cin.tie(0); ios::sync_with_stdio(false); ll n; cin >> n; dp[2][1] = 1; dp[2][2] = 1; REP(i,2,n){ dp[i+1][0] += dp[i][2]; dp[i+1][1] += dp[i][3]; dp[i+1][2] += dp[i][0] + dp[i][1]; dp[i+1][3] += dp[i][2]; rep(j,4){ dp[i][j] %= mod; } } ll ans = 0; rep(i,4){ ans += dp[n-1][i]; ans %= mod; } cout << ans << endl; return 0; }