#include <bits/stdc++.h>
using namespace std;
template <class T>
void pp(T v) {
  for (__typeof((v).begin()) it = (v).begin(); it != (v).end(); ++it)
    cout << *it << ' ';
  cout << endl;
}
template <class T>
void pp(T v, int n) {
  for (int i = 0; i < (int)n; i++) cout << v[i] << ' ';
  cout << endl;
}
const int INF = 1 << 28;
const double EPS = 1.0e-9;
static const int dx[] = {1, 0, -1, 0}, dy[] = {0, -1, 0, 1};
string s;
int N;
const long long MOD = 1000000007;
inline int mul(int a, int b) {
  long long res = a;
  res *= (long long)b;
  res %= (long long)MOD;
  return (int)res;
}
inline void chadd(int &a, int b) { a = (a + b) % (int)MOD; }
vector<vector<int> > concat(const vector<vector<int> > a,
                            const vector<vector<int> > b) {
  vector<vector<int> > res(3, vector<int>(3, 0));
  for (int l1 = 0; l1 < (int)3; l1++)
    for (int r1 = 0; r1 < (int)3; r1++)
      for (int l2 = 0; l2 < (int)3; l2++)
        for (int r2 = 0; r2 < (int)3; r2++) {
          if (r1 > 0 && r1 == l2) continue;
          chadd(res[l1][r2], mul(a[l1][r1], b[l2][r2]));
        }
  return res;
}
vector<vector<int> > bracket(const vector<vector<int> > &a) {
  vector<vector<int> > res(3, vector<int>(3, 0));
  for (int lin = 0; lin < (int)3; lin++)
    for (int rin = 0; rin < (int)3; rin++)
      for (int lout = 0; lout < (int)3; lout++)
        for (int rout = 0; rout < (int)3; rout++) {
          if (lin > 0 && lin == lout) continue;
          if (rin > 0 && rin == rout) continue;
          if (lout == rout) continue;
          if (lout > 0 && rout > 0) continue;
          chadd(res[lout][rout], a[lin][rin]);
        }
  return res;
}
pair<vector<vector<int> >, int> term(const int left);
pair<vector<vector<int> >, int> fact(const int left) {
  vector<vector<int> > res(3, vector<int>(3, 0));
  int right = left;
  if (s[left + 1] == ')') {
    res[0][1] = res[0][2] = 1;
    res[1][0] = res[2][0] = 1;
    right = left + 1;
  } else {
    pair<vector<vector<int> >, int> work = term(left + 1);
    right = work.second + 1;
    res = bracket(work.first);
  }
  return make_pair(res, right);
}
pair<vector<vector<int> >, int> term(const int left) {
  vector<int> terms;
  int depth = 0;
  int idx;
  int rem = left;
  for (idx = left; idx < N; idx++) {
    if (s[idx] == '(') {
      if (depth == 0) rem = idx;
      depth++;
    } else if (s[idx] == ')') {
      depth--;
      if (depth == 0) {
        terms.push_back(rem);
      } else if (depth < 0)
        break;
    }
  }
  const int right = idx - 1;
  vector<vector<int> > res = fact(terms[0]).first;
  for (int i = 1; i < terms.size(); i++) {
    res = concat(res, fact(terms[i]).first);
  }
  return make_pair(res, right);
}
int main(void) {
  cin >> s;
  N = s.size();
  vector<vector<int> > res = term(0).first;
  int ans = 0;
  for (int i = 0; i < (int)3; i++)
    for (int j = 0; j < (int)3; j++) {
      chadd(ans, res[i][j]);
    }
  cout << ans << endl;
  return 0;
}
