#include <iostream>
#include <string>
#include <stack>
#include <array>

using std::cin, std::cout, std::string, std::stack, std::array;

constexpr size_t MOD {998244353}, MAX_N {(size_t)3e5+5};
string s;
stack<size_t> st;
unsigned int prefix[MAX_N], ans, sum, left_num;
constexpr size_t char_size {1<<(sizeof(char)*8)};
constexpr array<int,char_size> install_array(){
    array<int,char_size> ret{};
    ret[40]=1;
    return ret;
}
constexpr array<int,char_size> map = install_array();

int main(){
    cin>>s;
    for(size_t i {0};i<s.size();i++){
        for(size_t j {i+1};j<=s.size();j++){
            for(size_t k{i};k<j;k++){
                for(size_t l{k+1};l<=j;l++){
                    left_num = 0;
                    for(size_t m{k};m<l;m++){
                        left_num+=map[s[m]];
                        if(s[m]==')'){
                            if(left_num<=0){
                                goto failed;
                            }
                            left_num--;
                        }
                    }
                    if(left_num==0){
                        ans=(ans+1)%MOD;
                    }
                    failed:;
                }
            }
        }
    }
    cout<<ans<<'\n';
}