// kでループ、部分列のとり方を全探索 #include #include #define FOR(i,k,n) for(int i = (k);i < (n);++i) #define REP(i,n) FOR(i,0,n) #define ALL(x) begin(x),end(x) using namespace std; using vecint = vector; using ll = int64_t; using vecll = vector; constexpr ll MOD = 998244353; int main() { ll n; cin>>n; string s; cin>>s; ll ans = 0; REP(k,n-1) { ll tmp = 0; ll len = k + 2; ll x, y; for (ll T = (1l << len) - 1; T < (1l << n); x = T & -T, y = T + x, T = (((T & ~y) / x) >> 1) | y) { int mn = __builtin_ctzll(T); int mx = 63 - __builtin_clzll(T); if (s[mn] == 'i' && s[mx] == 'n') { ++tmp; tmp %= MOD; } } ans ^= tmp; } cout<