n = int(input())
C = list(input())

a, b = 0, 0
for i in range(n):
    if C[i] == "R":
        a += 1
    ans = max(a, b)

for i in range(n):
    if C[i] == "R":
        a -= 1
    else:
        b += 1
    tmp = max(a, b)
    ans = min(ans, tmp)

print(ans) n = int(input()) n int(input()) int input() input C = list(input()) C list(input()) list input() input a, b = 0, 0 a 0 b 0 for i in range(n):
    if C[i] == "R":
        a += 1
    ans = max(a, b) i range(n) range n if C[i] == "R":
        a += 1
     C[i] == "R" C[i] C i "R" a += 1 a 1 ans = max(a, b) ans max(a, b) max a b for i in range(n):
    if C[i] == "R":
        a -= 1
    else:
        b += 1
    tmp = max(a, b)
    ans = min(ans, tmp) 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 tmp = max(a, b) tmp max(a, b) max a b ans = min(ans, tmp) ans min(ans, tmp) min ans tmp print(ans) print ans ans = min(ans, tmp) min(ans, tmp) ans a += 1 1 a a -= 1 1 a b = 0, 0 0 b b += 1 1 b n = int(input()) int(input()) n a, b = 0, 0 0 a ans = max(a, b) max(a, b) ans C = list(input()) list(input()) C tmp = max(a, b) max(a, b) tmp
n = int(input())
C = list(input())

a, b = 0, 0
for i in range(n):
    if C[i] == "R":
        a += 1
    ans = max(a, b)

for i in range(n):
    if C[i] == "R":
        a -= 1
    else:
        b += 1
    tmp = max(a, b)
    ans = min(ans, tmp)

print(ans)