n = int(eval(input()))

C = list(eval(input()))

l, r, c = 0, n-1, 0

while l < r:

    if C[l] == 'W' and C[r] == 'R':

        C[l], C[r] = C[r], C[l]

        l += 1

        r -= 1

        c += 1

    elif C[l] != 'W': l += 1

    elif C[r] != 'R': r -= 1

print(c)

n = int(eval(input()))

C = list(eval(input()))

l, r, c = 0, n-1, 0

while l < r:

    if C[l] != 'W': l += 1; continue

    if C[r] != 'R': r -= 1; continue

    l += 1

    r -= 1

    c += 1

print(c)

n = int(eval(input()))
C = list(eval(input()))
l, r, c = 0, n - 1, 0
while l < r:
    if C[l] == "W" and C[r] == "R":
        C[l], C[r] = C[r], C[l]
        l += 1
        r -= 1
        c += 1
    elif C[l] != "W":
        l += 1
    elif C[r] != "R":
        r -= 1
print(c)

n = int(eval(input()))
C = list(eval(input()))
l, r, c = 0, n - 1, 0
while l < r:
    if C[l] != "W":
        l += 1
        continue
    if C[r] != "R":
        r -= 1
        continue
    l += 1
    r -= 1
    c += 1
print(c)

-    if C[l] == "W" and C[r] == "R": -        C[l], C[r] = C[r], C[l] +    if C[l] != "W": +        continue +    if C[r] != "R": -        c += 1 -    elif C[l] != "W": -        l += 1 -    elif C[r] != "R": -        r -= 1 +        continue +    l += 1 +    r -= 1 +    c += 1