#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};
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; }
int solve(const string& s) {
  static int work[3][3];
  static int stack[1024][3][3];
  memset(stack, 0, sizeof(stack));
  int p = 0;
  for (int i = 0; i < (int)s.size(); i++) {
    if (s[i] == '1') {
      stack[p][0][1] = 1;
      stack[p][0][2] = 1;
      stack[p][1][0] = 1;
      stack[p][2][0] = 1;
      p++;
    } else if (s[i] == '+') {
      memset(work, 0, sizeof(work));
      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(work[l1][r2],
                    mul(stack[p - 2][l1][r1], stack[p - 1][l2][r2]));
            }
      p -= 2;
      for (int i = 0; i < (int)3; i++)
        for (int j = 0; j < (int)3; j++) stack[p][i][j] = work[i][j];
      p++;
    } else if (s[i] == '-') {
      memset(work, 0, sizeof(work));
      p--;
      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(work[lout][rout], stack[p][lin][rin]);
            }
      for (int i = 0; i < (int)3; i++)
        for (int j = 0; j < (int)3; j++) stack[p][i][j] = work[i][j];
      p++;
    }
  }
  int ans = 0;
  for (int i = 0; i < (int)3; i++)
    for (int j = 0; j < (int)3; j++) {
      chadd(ans, stack[0][i][j]);
    }
  return ans;
}
int main(void) {
  vector<char> oprnd;
  string input;
  cin >> input;
  string buf;
  for (int i = 0; i < (int)input.size(); i++) {
    buf += input[i];
    if (i + 1 < input.size() && input[i] == ')' && input[i + 1] == '(')
      buf += '+';
  }
  input = buf;
  string s = "";
  for (int i = 0; i < (int)input.size(); i++) {
    if (input[i] == '+') {
      oprnd.push_back(input[i]);
    } else if (input[i] == '(') {
      oprnd.push_back(input[i]);
    } else {
      if (input[i - 1] == '(') {
        s += '1';
        oprnd.pop_back();
      } else {
        s += '-';
        oprnd.pop_back();
      }
      if (oprnd.back() == '+') {
        s += '+';
        oprnd.pop_back();
      }
    }
  }
  int ans = solve(s);
  cout << ans << endl;
  return 0;
}
