#include <bits/stdc++.h>
using namespace std;
int INF = 100000000;
double EPS = 1e-8;
long long MOD = 1000000007LL;
int p[701];
long long memo[701][701][3][3];
long long dfs(int L, int R, int a, int b) {
  if (memo[L][R][a][b] != -1) return memo[L][R][a][b];
  if (L == R) return memo[L][R][a][b] = 1;
  long long ret = 0;
  if (a != 1) {
    ret = (ret + dfs(L + 1, p[L], 1, 0) * dfs(p[L] + 1, R, 0, b)) % MOD;
  }
  if (a != 2) {
    ret = (ret + dfs(L + 1, p[L], 2, 0) * dfs(p[L] + 1, R, 0, b)) % MOD;
  }
  if (p[L] + 1 < R || b != 1) {
    ret = (ret + dfs(L + 1, p[L], 0, 1) * dfs(p[L] + 1, R, 1, b)) % MOD;
  }
  if (p[L] + 1 < R || b != 2) {
    ret = (ret + dfs(L + 1, p[L], 0, 2) * dfs(p[L] + 1, R, 2, b)) % MOD;
  }
  return memo[L][R][a][b] = ret;
}
int main() {
  string s;
  cin >> s;
  stack<int> st;
  for (int i = 0; i < (int)((s).size()); ++i) {
    if (s[i] == ')') {
      p[st.top()] = i;
      st.pop();
    } else
      st.push(i);
  }
  memset(memo, -1, sizeof(memo));
  cout << dfs(0, (int)((s).size()), 0, 0) << endl;
  return 0;
}
