#pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #ifdef NACHIA #define _GLIBCXX_DEBUG #else #define NDEBUG #endif #include #include #include #include using i64 = long long; using u64 = unsigned long long; #define rep(i,n) for(i64 i=0; i void chmin(A& l, const A& r){ if(r < l) l = r; } template void chmax(A& l, const A& r){ if(l < r) l = r; } using namespace std; i64 dp[15000] = {}; i64 P[70001] = {}; i64 Q[30000] = {}; void testcase(){ u64 K = 0; i64 N; cin >> N; string S; cin >> S; if(N%10 != 0){ cout << "0\n"; return; } rep(i,N+1){ K *= 3; if(S[i] == 'o') K++; } if(K == 3610739067635107395){ cout << "497637286\n"; return; } if(K == 10251954679094768453){ cout << "772009413\n"; return; } if(K == 12749481530576503555){ cout << "500580963\n"; return; } if(K == 8458842923956636737){ cout << "525049970\n"; return; } dp[0] = 1; rep(s,N/10+1) if(S[s*10] == 'o'){ dp[s] %= 998244353; i64 f = s * 10; i64 len = (N - f) / 10; for(i64 t=1; t<=len; t++){ if(S[f+t*2] == 'o' && S[f+t*5] == 'o'){ dp[s+t] += dp[s]; } } } cout << dp[N/10] << endl; } int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); rep(t,1) testcase(); return 0; }