N = int(input())
c = list(input())

a=0
b=0

a = c.count("R")
ans = c.count("R")
for i in range(N):
    if c[i] == "R":
        a -= 1
    else:
        b += 1

    now = max(a,b)
    ans = min(ans, now)

print(ans) N = int(input()) N int(input()) int input() input c = list(input()) c list(input()) list input() input a=0 a 0 b=0 b 0 a = c.count("R") a c.count("R") c.count c count "R" ans = c.count("R") ans c.count("R") c.count c count "R" for i in range(N):
    if c[i] == "R":
        a -= 1
    else:
        b += 1

    now = max(a,b)
    ans = min(ans, now) i range(N) range N if c[i] == "R":
        a -= 1
    else:
        b += 1

     c[i] == "R" c[i] c i "R" a -= 1 a 1 b += 1 b 1 now = max(a,b) now max(a,b) max a b ans = min(ans, now) ans min(ans, now) min ans now print(ans) print ans b=0 0 b N = int(input()) int(input()) N b += 1 1 b now = max(a,b) max(a,b) now ans = c.count("R") c.count("R") ans c = list(input()) list(input()) c a=0 0 a a = c.count("R") c.count("R") a ans = min(ans, now) min(ans, now) ans a -= 1 1 a
N = int(input())
c = list(input())

a=0
b=0

a = c.count("R")
ans = c.count("R")
for i in range(N):
    if c[i] == "R":
        a -= 1
    else:
        b += 1

    now = max(a,b)
    ans = min(ans, now)

print(ans)