#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-7;
const int INF = 0x7f7f7f7f;
const long long mo = 998244353;
template <typename _T>
_T Fabs(_T x) {
  return x < 0 ? -x : x;
}
template <typename _T>
void read(_T &x) {
  _T f = 1;
  x = 0;
  char s = getchar();
  while (s > '9' || s < '0') {
    if (s == '-') f = -1;
    s = getchar();
  }
  while ('0' <= s && s <= '9') {
    x = (x << 3) + (x << 1) + (s ^ 48);
    s = getchar();
  }
  x *= f;
}
int qkpow(int a, int s) {
  int t = 1;
  while (s) {
    if (s & 1) t = 1ll * a * t % mo;
    a = 1ll * a * a % mo;
    s >>= 1;
  }
  return t;
}
int add(int x, int y) { return x + y >= mo ? x + y - mo : x + y; }
int n, dp[2005][2005], len, a[2005], sum[2005];
char str[2005];
signed main() {
  scanf("%s", str + 1);
  len = (int)strlen(str + 1);
  for (int i = 1; i <= len; i++) {
    if (str[i] == '(') a[i] = 1;
    if (str[i] == ')') a[i] = -1;
    sum[i] = sum[i - 1] + (!a[i]);
  }
  for (int k = 2; k <= len; k++)
    for (int i = 1; i <= len - k + 1; i++) {
      int j = i + k - 1;
      if (a[i] <= 0) dp[i][j] = add(dp[i][j], dp[i + 1][j]);
      if (a[j] >= 0) dp[i][j] = add(dp[i][j], dp[i][j - 1]);
      if (a[i] <= 0 && a[j] >= 0)
        dp[i][j] = add(dp[i][j], mo - dp[i + 1][j - 1]);
      if (a[i] >= 0 && a[j] <= 0)
        dp[i][j] =
            add(dp[i][j], add(qkpow(2, sum[j - 1] - sum[i]), dp[i + 1][j - 1]));
    }
  printf("%d\n", dp[1][len]);
  return 0;
}
