#define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; #include using namespace std; template using V=vector; template using VV=V>; const int MOD=998244353; ll dp[200200][3]; int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); int n; string s; cin>>n>>s; dp[0][1]=1; rep(i,n){ if(s[i]=='L'){ dp[i+1][2]=(dp[i+1][2]+dp[i][1]+dp[i][2])%MOD; } else if(s[i]=='U'){ dp[i+1][1]=(dp[i+1][1]+dp[i][0]+dp[i][1]+dp[i][2])%MOD; } else if(s[i]=='R'){ dp[i+1][0]=(dp[i+1][0]+dp[i][0]+dp[i][1]+dp[i][2])%MOD; } else{ dp[i+1][0]=(dp[i+1][0]+dp[i][0]+dp[i][1]+dp[i][2])%MOD; dp[i+1][1]=(dp[i+1][1]+dp[i][0]+dp[i][1]+dp[i][2])%MOD; dp[i+1][2]=(dp[i+1][2]+dp[i][1]+dp[i][2])%MOD; } } ll ans=0; rep(i,3) ans=(ans+dp[n][i])%MOD; cout<