#include #include #include #include using namespace std; #define endl '\n' #define PB push_back #define ALL(a) (a).begin(),(a).end() #define SZ(a) int((a).size()) #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--) #define REP(i,n) FOR(i,0,n) #define RREP(i,n) for (int i=(n)-1;i>=0;i--) #define DEBUG(x) cout<<#x<<": "< P; typedef long long int LL; typedef unsigned long long ULL; typedef pair LP; LL dp[1000000+10][3]; const int mod = 1000000007; int main() { ios::sync_with_stdio(false); cin.tie(0); int N; cin >> N; dp[0][1] = dp[0][2] = 0; dp[0][0] = 1; FOR(i,1,N+1){ dp[i][0] = (dp[i-1][1]+dp[i-1][2])%mod; dp[i][1] = (dp[i-1][0])%mod; dp[i][2] = dp[i-1][1]%mod; } cout << (dp[N][0]+dp[N][1]+dp[N][2])%mod << endl; return 0; }