#include <bits/stdc++.h>
using namespace std;
template <class T, class U>
void ckmin(T &a, U b) {
  if (a > b) a = b;
}
template <class T, class U>
void ckmax(T &a, U b) {
  if (a < b) a = b;
}
int N;
int arr[2013];
long long dp[2][2013][2013];
bitset<2013> vis[2][2013];
long long ans;
long long solve(int a, int b, bool need) {
  if (a > b) return 0;
  if (vis[need][a][b]) {
    return dp[need][a][b];
  }
  long long res = 0;
  vis[need][a][b] = true;
  if (need) {
    if (a == b)
      res = 0;
    else if (arr[a] == -1) {
      res = solve(a + 1, b, 1);
    } else if (arr[a] == 1) {
      res = solve(a + 1, b, 0);
    } else if (arr[a] == 0) {
      res = 499122177 * solve(a + 1, b, 0) + 499122177 * solve(a + 1, b, 1);
    }
  } else {
    if (arr[b] == -1) {
      res = solve(a, b - 1, 1) + 1;
    } else if (arr[b] == 1) {
      res = solve(a, b - 1, 0);
    } else {
      res = 499122177 * (solve(a, b - 1, 1) + 1) +
            499122177 * (solve(a, b - 1, 0));
    }
  }
  res %= 998244353;
  dp[need][a][b] = res;
  return res;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(12);
  cerr << fixed << setprecision(4);
  string temps;
  cin >> temps;
  N = ((int)((temps).size()));
  for (auto i = (0); i < (N); i++) {
    if (temps[i] == '(') arr[i] = 1;
    if (temps[i] == ')') arr[i] = -1;
  }
  ans = solve(0, N - 1, 1);
  for (auto i = (0); i < (N); i++) {
    if (arr[i] == 0) {
      ans += ans;
      if (ans >= 998244353) ans -= 998244353;
    }
  }
  cout << ans << '\n';
  return 0;
}
