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;
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};
string s;
int N;
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; }
vector<vector<int> > concat(const vector<vector<int> > a,
                            const vector<vector<int> > b) {
  vector<vector<int> > res(3, vector<int>(3, 0));
  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(res[l1][r2], mul(a[l1][r1], b[l2][r2]));
        }
  return res;
}
vector<vector<int> > bracket(const vector<vector<int> > &a) {
  vector<vector<int> > res(3, vector<int>(3, 0));
  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(res[lout][rout], a[lin][rin]);
        }
  return res;
}
pair<vector<vector<int> >, int> term(const int left);
pair<vector<vector<int> >, int> fact(const int left) {
  vector<vector<int> > res(3, vector<int>(3, 0));
  int right = left;
  if (s[left + 1] == ')') {
    res[0][1] = res[0][2] = 1;
    res[1][0] = res[2][0] = 1;
    right = left + 1;
  } else {
    pair<vector<vector<int> >, int> work = term(left + 1);
    right = work.second + 1;
    res = bracket(work.first);
  }
  return make_pair(res, right);
}
pair<vector<vector<int> >, int> term(const int left) {
  vector<int> terms;
  int depth = 0;
  int idx;
  int rem = left;
  for (idx = left; idx < N; idx++) {
    if (s[idx] == '(') {
      if (depth == 0) rem = idx;
      depth++;
    } else if (s[idx] == ')') {
      depth--;
      if (depth == 0) {
        terms.push_back(rem);
      } else if (depth < 0)
        break;
    }
  }
  const int right = idx - 1;
  vector<vector<int> > res = fact(terms[0]).first;
  for (int i = 1; i < terms.size(); i++) {
    res = concat(res, fact(terms[i]).first);
  }
  return make_pair(res, right);
}
int main(void) {
  cin >> s;
  N = s.size();
  vector<vector<int> > res = term(0).first;
  int ans = 0;
  for (int i = 0; i < (int)3; i++)
    for (int j = 0; j < (int)3; j++) {
      chadd(ans, res[i][j]);
    }
  cout << ans << endl;
  return 0;
}