#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
const int MOD = 998244353;
pair<int, int> dp[2005][2005][2];
bool vis[2005][2005][2];
inline int add(int x, int y) {
  if ((x += y) >= MOD) x -= MOD;
  return x;
}
string s;
pair<int, int> solve(int l, int r, bool f) {
  if (l > r) return make_pair(0, 1);
  if (vis[l][r][f]) return dp[l][r][f];
  vis[l][r][f] = true;
  pair<int, int> &ret = dp[l][r][f];
  ret = pair<int, int>(0, 0);
  if (!f) {
    if (s[l] != ')') {
      auto x = solve(l + 1, r, f ^ 1);
      ret.first = add(ret.first, x.first);
      ret.second = add(ret.second, x.second);
    }
    if (s[l] != '(') {
      auto x = solve(l + 1, r, f);
      ret.first = add(ret.first, x.first);
      ret.second = add(ret.second, x.second);
    }
  } else {
    if (s[r] != '(') {
      auto x = solve(l, r - 1, f ^ 1);
      ret.first = add(ret.first, x.first);
      ret.first = add(ret.first, x.second);
      ret.second = add(ret.second, x.second);
    }
    if (s[r] != ')') {
      auto x = solve(l, r - 1, f);
      ret.first = add(ret.first, x.first);
      ret.second = add(ret.second, x.second);
    }
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> s;
  cout << solve(0, s.size() - 1, 0).first << endl;
  return 0;
}
