#include <bits/stdc++.h>
using namespace std;
template <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return rge<c>{i, j};
}
template <class c>
auto dud(c *x) -> decltype(std::cerr << *x, 0);
template <class c>
char dud(...);
struct debug {
  template <class c>
  debug &operator<<(const c &) {
    return *this;
  }
};
const int mod1 = 1e5 + 7;
const int N = 1e6 + 7;
const long long mod2 = 1e9 + 7;
const long long mod3 = 1e12 + 7;
const int si = 1050;
string s;
long long dp[750][750][5][5];
int a[750], b[750];
void dfs(int l, int r) {
  if (l + 1 == r) {
    dp[l][r][0][1] = 1;
    dp[l][r][1][0] = 1;
    dp[l][r][2][0] = 1;
    dp[l][r][0][2] = 1;
    return;
  }
  if (a[l] == r) {
    dfs(l + 1, r - 1);
    for (int i = 0; i < 3; i++)
      for (int j = 0; j < 3; j++) {
        if (i != 1)
          dp[l][r][1][0] = (dp[l][r][1][0] + dp[l + 1][r - 1][i][j]) % mod2;
        if (j != 1)
          dp[l][r][0][1] = (dp[l][r][0][1] + dp[l + 1][r - 1][i][j]) % mod2;
        if (i != 2)
          dp[l][r][2][0] = (dp[l][r][2][0] + dp[l + 1][r - 1][i][j]) % mod2;
        if (j != 2)
          dp[l][r][0][2] = (dp[l][r][0][2] + dp[l + 1][r - 1][i][j]) % mod2;
      }
  } else {
    int pos = a[l];
    dfs(l, pos);
    dfs(pos + 1, r);
    for (int i = 0; i < 3; i++)
      for (int j = 0; j < 3; j++)
        for (int x = 0; x < 3; x++)
          for (int y = 0; y < 3; y++)
            if ((x != y) || (x == 0 && y == 0))
              dp[l][r][i][j] =
                  (dp[l][r][i][j] +
                   (dp[l][pos][i][x] * dp[pos + 1][r][y][j]) % mod2) %
                  mod2;
  }
}
int main() {
  cin >> s;
  int len = s.length(), k = 0;
  for (int i = 0; i < len; i++) {
    if (s[i] == '(')
      b[k++] = i;
    else {
      a[i] = b[k - 1];
      a[b[k - 1]] = i;
      k--;
    }
  }
  dfs(0, len - 1);
  long long ans = 0;
  for (int i = 0; i < 3; i++)
    for (int j = 0; j < 3; j++) ans = (ans + dp[0][len - 1][i][j]) % mod2;
  printf("%lld\n", ans);
  return 0;
}
