#include <bits/stdc++.h>
using namespace std;
int powmod(int a, int b, int p) {
  int ans = 1;
  for (; b; a = (long long)a * a % p, (b >>= 1))
    if (b & 1) ans = (long long)ans * a % p;
  return ans;
}
int n, a[2001], s[2001], f[2001][2001];
char c[2001], ch;
int main() {
  scanf("%s", c + 1);
  n = strlen(c + 1);
  for (int i = 1; i <= n; i++) {
    ch = c[i];
    if (ch == '(')
      a[i] = 1;
    else if (ch == ')')
      a[i] = -1;
  }
  for (int i = 1; i <= n; i++)
    if (a[i])
      s[i] = s[i - 1];
    else
      s[i] = s[i - 1] + 1;
  for (int l = 2; l <= n; l++)
    for (int i = 1, j = l; j <= n; i++, j++) {
      if (a[i] != 1) (f[i][j] += f[i + 1][j]) %= 998244353;
      if (a[j] != -1) (f[i][j] += f[i][j - 1]) %= 998244353;
      if (a[i] != 1 && a[j] != -1)
        (f[i][j] -= f[i + 1][j - 1] - 998244353) %= 998244353;
      if (a[i] != -1 && a[j] != 1)
        (f[i][j] += (f[i + 1][j - 1] + powmod(2, s[j - 1] - s[i], 998244353)) %
                    998244353) %= 998244353;
    }
  printf("%d", f[1][n]);
  return 0;
}
