#include <bits/stdc++.h>
using namespace std;
char s[705];
int n;
struct data {
  int col[10];
  data() { memset(col, 0, sizeof(col)); }
};
data single;
inline void add(int &x, int y) {
  x += y;
  if (x >= 1000000007) x -= 1000000007;
}
inline int Mul(int x, int y) { return 1ll * x * y % 1000000007; }
void update(data &x, data y) {
  for (int i = 3; i < 9; ++i) add(x.col[2], y.col[i]);
  for (int i = 0; i < 3; ++i) add(x.col[5], y.col[i]);
  for (int i = 6; i < 9; ++i) add(x.col[5], y.col[i]);
  for (int i = 1; i < 9; i += 3)
    add(x.col[6], y.col[i]), add(x.col[6], y.col[i + 1]);
  for (int i = 0; i < 9; i += 3)
    add(x.col[7], y.col[i]), add(x.col[7], y.col[i + 2]);
}
data Merge(data x, data y) {
  data ret;
  for (int c = 0; c < 9; ++c) {
    int col1 = c / 3, col2 = c % 3;
    for (int c1 = 0; c1 < 9; ++c1)
      for (int c2 = 0; c2 < 9; ++c2) {
        int xx = c1 / 3, yy = c1 % 3, m = c2 / 3, n = c2 % 3;
        if (xx != col1 || n != col2) continue;
        if (yy == 2 || m == 2)
          add(ret.col[c], Mul(x.col[c1], y.col[c2]));
        else if (yy != m)
          add(ret.col[c], Mul(x.col[c1], y.col[c2]));
      }
  }
  return ret;
}
data dfs(int l, int r) {
  if (l > r) return single;
  vector<data> a;
  a.clear();
  int L = l, cnt = 0;
  for (int i = l; i <= r; ++i) {
    if (s[i] == '(')
      ++cnt;
    else
      --cnt;
    if (!cnt) {
      data t, x;
      if (L + 1 > i - 1)
        x = single;
      else
        t = dfs(L + 1, i - 1);
      update(x, t);
      a.push_back(x);
      L = i + 1;
    }
  }
  for (int i = 0; i < a.size() - 1; ++i) a[i + 1] = Merge(a[i], a[i + 1]);
  return a[a.size() - 1];
}
int main() {
  single.col[2] = single.col[5] = single.col[6] = single.col[7] = 1;
  scanf("%s", s);
  n = strlen(s);
  data t = dfs(0, n - 1);
  int ans = 0;
  for (int i = 0; i < 9; ++i) add(ans, t.col[i]);
  printf("%d\n", ans);
  return 0;
}
