#include <bits/stdc++.h>
using namespace std;
const long double PI = acos(-1);
const long long mod1 = 1000000007;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  int temp = max(n + 1, 5);
  vector<long long> vec(temp);
  vec[0] = 0;
  vec[1] = 0;
  vec[2] = 3;
  vec[3] = 6;
  vec[4] = 21;
  for (int i = 5; i <= n; i++) {
    vec[i] = vec[i - 2] * 3;
    vec[i] %= mod1;
    vec[i] += (vec[i - 1] * 2);
    vec[i] %= mod1;
  }
  cout << vec[n] << endl;
}
