#pragma GCC optimize ("O2")
#pragma GCC target ("avx")
#include<bits/stdc++.h>
//#include<atcoder/all>
//using namespace atcoder;

using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

char S[1000000], *i = S + 500000, *ato = i, *mae = ato, c;

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	fread(i, 1, 500000, stdin);

	int r = 0;
	while ((c = *i++) >= 'R') {
		if (c == 'R') r ^= 1;
		else {
			if (r) {
				if (mae == ato || *mae != c) *--mae = c;
				else mae++;
			}
			else {
				if (mae == ato || *(ato - 1) != c) *ato++ = c;
				else ato--;
			}
		}
	}

	if (r) reverse(mae, ato);
	fwrite(mae, 1, ato - mae, stdout);

	Would you please return 0;
}
/* #pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") */
// only when really needed
 
#include <bits/stdc++.h>
  
#define for1(i,a,b) for (int i = a; i <= b; i++)
#define for2(i,a,b) for (int i = a; i >= b; i--)
#define int long long
#define sz(a) (int)a.size()
 
#define PI 3.1415926535897932384626433832795
#define INF 8000000000000000000
#define MOD 1000000007
 
using namespace std;
 
signed main() {
    
    int n,x;
    string s;
    cin >> n >> x;
    cin >> s;
    for1(i,0,n-1) {
        if (s[i]=='o') x++;
        else if (x>0) x--;
    }
    cout << x;
    
}