
// Problem : B - Abbreviate Fox
// Contest : AtCoder - AtCoder Regular Contest 108
// URL : https://atcoder.jp/contests/arc108/tasks/arc108_b
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include <bits/stdc++.h>
#define DEBUG fprintf(stderr, "Passing [%s] line %d\n", __FUNCTION__, __LINE__)
#define File(x) freopen(x".in","r",stdin); freopen(x".out","w",stdout)

using namespace std;

typedef long long LL;
typedef pair <int, int> PII;
typedef pair <int, PII> PIII;

template <typename T>
inline T gi()
{
    T f = 1, x = 0; char c = getchar();
    while (c < '0' || c > '9') {if (c == '-') f = -1; c = getchar();}
    while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
    return f * x;
}

const int INF = 0x3f3f3f3f, N = 200003, M = N << 1;

int n;
char s[N], stk[N];
int tp;

int main()
{
    //File("");
    n = gi <int> ();
    scanf("%s", s + 1);
    for (int i = 1; i <= n; i+=1)
    {
    	stk[++tp] = s[i];
    	if (tp >= 3 && stk[tp] == 'x' && stk[tp - 1] == 'o' && stk[tp - 2] == 'f')
    		tp -= 3;
    }
    printf("%d\n", tp);
    return 0;
}
#include<cstdio>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<queue>
using namespace std;
int main(){
    int H,W;
    cin>>H>>W;
    string fie[510];
    for(int i=0;i<H;i++)cin>>fie[i];
    int flglis[1010]={0};
    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            if(fie[i][j]=='B')flglis[i+j]=flglis[i+j]|1;
            if(fie[i][j]=='R')flglis[i+j]=flglis[i+j]|2;
        }
    }
    long long int ans=1;
    for(int i=0;i<=H+W-2;i++){
        if(flglis[i]==0){
            ans*=2;
            ans%=998244353;
        }
        else if(flglis[i]==3){
            ans*=0;
        }
    }
    cout<<ans<<endl;
    return 0;
}
