#include using namespace std; const int MOD = 998244353; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int N; cin >> N; string A; cin >> A; int K = 0; for (int i = 0; i < N-1; i++) { if (A[i] != A[i+1]) K++; } if (K == 0) { cout << 1 << '\n'; return 0; } long long ans = 1; for (int i = 0; i < K; i++) { ans = (ans * 2) % MOD; } cout << ans << '\n'; }