#include #define rep(i,n) for(int i = 0; i < (n); ++i) #define srep(i,s,t) for (int i = s; i < t; ++i) #define drep(i,n) for(int i = (n)-1; i >= 0; --i) using namespace std; typedef long long int ll; typedef pair P; #define yn {puts("Yes");}else{puts("No");} #define MAX_N 200005 int main() { const ll MOD = 1000000007; int n; cin >> n; ll dp[n+100][4]; rep(i,n+100)rep(j,4)dp[i][j] = 0; dp[11][1] = 1; dp[12][2] = 1; dp[13][3] = 1; srep(i,11,n+11){ srep(j,1,4){ srep(k,1,4){ if(j == k) continue; dp[i+k][k] += dp[i][j]; dp[i+k][k] %= MOD; } } } ll ans = 0; srep(j,1,4) ans += dp[n+10][j]; ans %= MOD; cout << ans << endl; return 0; }