Problem: Once Petya read a problem about a bracket sequence. He gave it much thought but didn't find a solution. Today you will face it.

You are given string s. It represents a correct bracket sequence. A correct bracket sequence is the sequence of opening ("(") and closing (")") brackets, such that it is possible to obtain a correct mathematical expression from it, inserting numbers and operators between the brackets. For example, such sequences as "(())()" and "()" are correct bracket sequences and such sequences as ")()" and "(()" are not.

In a correct bracket sequence each bracket corresponds to the matching bracket (an opening bracket corresponds to the matching closing bracket and vice versa). For example, in a bracket sequence shown of the figure below, the third bracket corresponds to the matching sixth one and the fifth bracket corresponds to the fourth one.

<image>

You are allowed to color some brackets in the bracket sequence so as all three conditions are fulfilled: 

  * Each bracket is either not colored any color, or is colored red, or is colored blue. 
  * For any pair of matching brackets exactly one of them is colored. In other words, for any bracket the following is true: either it or the matching bracket that corresponds to it is colored. 
  * No two neighboring colored brackets have the same color. 



Find the number of different ways to color the bracket sequence. The ways should meet the above-given conditions. Two ways of coloring are considered different if they differ in the color of at least one bracket. As the result can be quite large, print it modulo 1000000007 (109 + 7).

Input

The first line contains the single string s (2 ≤ |s| ≤ 700) which represents a correct bracket sequence. 

Output

Print the only number — the number of ways to color the bracket sequence that meet the above given conditions modulo 1000000007 (109 + 7).

Examples

Input

(())


Output

12


Input

(()())


Output

40


Input

()


Output

4

Note

Let's consider the first sample test. The bracket sequence from the sample can be colored, for example, as is shown on two figures below. 

<image> <image>

The two ways of coloring shown below are incorrect. 

<image> <image>

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
void __print(int x) { cerr << x; }
void __print(long x) { cerr << x; }
void __print(long long x) { cerr << x; }
void __print(unsigned x) { cerr << x; }
void __print(unsigned long x) { cerr << x; }
void __print(unsigned long long x) { cerr << x; }
void __print(float x) { cerr << x; }
void __print(double x) { cerr << x; }
void __print(long double x) { cerr << x; }
void __print(char x) { cerr << '\'' << x << '\''; }
void __print(const char *x) { cerr << '\"' << x << '\"'; }
void __print(const string &x) { cerr << '\"' << x << '\"'; }
void __print(bool x) { cerr << (x ? "true" : "false"); }
template <typename T, typename V>
void __print(const pair<T, V> &x) {
  cerr << '{';
  __print(x.first);
  cerr << ',';
  __print(x.second);
  cerr << '}';
}
template <typename T>
void __print(const T &x) {
  int f = 0;
  cerr << '{';
  for (auto &i : x) cerr << (f++ ? "," : ""), __print(i);
  cerr << "}";
}
void _print() { cerr << "]\n"; }
template <typename T, typename... V>
void _print(T t, V... v) {
  __print(t);
  if (sizeof...(v)) cerr << ", ";
  _print(v...);
}
struct custom_hash {
  static uint64_t splitmix64(uint64_t x) {
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
  }
  size_t operator()(uint64_t x) const {
    static const uint64_t FIXED_RANDOM =
        chrono::steady_clock::now().time_since_epoch().count();
    return splitmix64(x + FIXED_RANDOM);
  }
};
long long int add(long long int a, long long int b,
                  long long int p = 1000000007) {
  a %= p;
  b %= p;
  return (a + b + p) % p;
}
long long int mul(long long int a, long long int b,
                  long long int p = 1000000007) {
  a %= p;
  b %= p;
  return (a * b + p) % p;
}
long long int power(long long int x, long long int n,
                    long long int p = 1000000007) {
  if (x == 0) return 0;
  if (n == 0 || x == 1) return 1LL;
  long long int r = (power(x, n / 2, p)) % p;
  if (n & 1)
    return mul(mul(r, r, p), x, p);
  else
    return mul(r, r, p);
}
long long int inv(long long int x) { return power(x, 1000000007 - 2); }
long long int gcd(long long int a, long long int b) {
  if (b == 0)
    return a;
  else if (a == 0)
    return b;
  else
    return gcd(b, a % b);
}
long long int lcm(long long int a, long long int b) {
  return (a * b) / gcd(a, b);
}
pair<int, int> dx[4] = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}};
string s;
bool check[707][707];
vector<int> validIndex[707];
int dp[707][707][3][3];
int get(const int i, const int j, const int cStart, const int cEnd) {
  if (i > j) return 1;
  if (dp[i][j][cStart][cEnd] != -1) return dp[i][j][cStart][cEnd];
  int ans = 0;
  for (auto &index : validIndex[i]) {
    if (index == j) continue;
    for (long long int c = 0; c < 2; c++) {
      if (cStart != c + 1) {
        int cnt = ((long long int)get(i + 1, index - 1, c + 1, 0) *
                   get(index + 1, j, 0, cEnd)) %
                  1000000007;
        ans += cnt;
        if (ans >= 1000000007) ans -= 1000000007;
      }
      int cnt = ((long long int)get(i + 1, index - 1, 0, c + 1) *
                 get(index + 1, j, c + 1, cEnd)) %
                1000000007;
      ans += cnt;
      if (ans >= 1000000007) ans -= 1000000007;
    }
  }
  if (check[i][j]) {
    for (long long int c = 0; c < 2; c++) {
      if (cStart != c + 1) {
        ans += get(i + 1, j - 1, c + 1, 0);
        if (ans >= 1000000007) ans -= 1000000007;
      }
      if (cEnd != c + 1) {
        ans += get(i + 1, j - 1, 0, c + 1);
        if (ans >= 1000000007) ans -= 1000000007;
      }
    }
  }
  return dp[i][j][cStart][cEnd] = ans;
}
bool isBal(string &st) {
  stack<char> s;
  for (auto &i : st) {
    if (i == '(')
      s.push('(');
    else {
      if (s.empty())
        return 0;
      else
        s.pop();
    }
  }
  return (s.size() == 0);
}
void __sol() {
  cin >> s;
  int n = s.size();
  s = '#' + s;
  memset(check, 0, sizeof(check));
  for (int i = 1; i <= n; i++) {
    for (int j = i; j <= n; j++) {
      string temp = s.substr(i, j - i + 1);
      check[i][j] = isBal(temp);
      if (check[i][j]) validIndex[i].emplace_back(j);
    }
  }
  memset(dp, -1, sizeof(dp));
  cout << get(1, n, 0, 0);
}
int main() {
  clock_t time_req = clock();
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int tc = 1;
  while (tc--) __sol();
  time_req = clock() - time_req;
  cerr << "Finished in: " << (float)time_req / CLOCKS_PER_SEC << " seconds"
       << endl;
  return 0;
}