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};
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; }
int solve(const string& s) {
  static int work[3][3];
  static int stack[1024][3][3];
  memset(stack, 0, sizeof(stack));
  int p = 0;
  for (int i = 0; i < (int)s.size(); i++) {
    if (s[i] == '1') {
      stack[p][0][1] = 1;
      stack[p][0][2] = 1;
      stack[p][1][0] = 1;
      stack[p][2][0] = 1;
      p++;
    } else if (s[i] == '+') {
      memset(work, 0, sizeof(work));
      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(work[l1][r2],
                    mul(stack[p - 2][l1][r1], stack[p - 1][l2][r2]));
            }
      p -= 2;
      for (int i = 0; i < (int)3; i++)
        for (int j = 0; j < (int)3; j++) stack[p][i][j] = work[i][j];
      p++;
    } else if (s[i] == '-') {
      memset(work, 0, sizeof(work));
      p--;
      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(work[lout][rout], stack[p][lin][rin]);
            }
      for (int i = 0; i < (int)3; i++)
        for (int j = 0; j < (int)3; j++) stack[p][i][j] = work[i][j];
      p++;
    }
  }
  int ans = 0;
  for (int i = 0; i < (int)3; i++)
    for (int j = 0; j < (int)3; j++) {
      chadd(ans, stack[0][i][j]);
    }
  return ans;
}
int main(void) {
  vector<char> oprnd;
  string input;
  cin >> input;
  string buf;
  for (int i = 0; i < (int)input.size(); i++) {
    buf += input[i];
    if (i + 1 < input.size() && input[i] == ')' && input[i + 1] == '(')
      buf += '+';
  }
  input = buf;
  string s = "";
  for (int i = 0; i < (int)input.size(); i++) {
    if (input[i] == '+') {
      oprnd.push_back(input[i]);
    } else if (input[i] == '(') {
      oprnd.push_back(input[i]);
    } else {
      if (input[i - 1] == '(') {
        s += '1';
        oprnd.pop_back();
      } else {
        s += '-';
        oprnd.pop_back();
      }
      if (oprnd.back() == '+') {
        s += '+';
        oprnd.pop_back();
      }
    }
  }
  int ans = solve(s);
  cout << ans << endl;
  return 0;
}