N = int(input())
C = input()

WL = [0]
RR = [C.count('R')]

for i in range(0, N):
    if C[i] == 'R':
        WL.append(WL[i])
        RR.append(RR[i] - 1)
    else:
        WL.append(WL[i] + 1)
        RR.append(RR[i])

MM = N
for i in range(0, N + 1):
    MM = min(MM, (max(WL[i], RR[i])))
print(MM) N = int(input()) N int(input()) int input() input C = input() C input() input WL = [0] WL [0] 0 RR = [C.count('R')] RR [C.count('R')] C.count('R') C.count C count 'R' for i in range(0, N):
    if C[i] == 'R':
        WL.append(WL[i])
        RR.append(RR[i] - 1)
    else:
        WL.append(WL[i] + 1)
        RR.append(RR[i]) i range(0, N) range 0 N if C[i] == 'R':
        WL.append(WL[i])
        RR.append(RR[i] - 1)
    else:
        WL.append(WL[i] + 1)
        RR.append(RR[i]) C[i] == 'R' C[i] C i 'R' WL.append(WL[i]) WL.append WL append WL[i] WL i RR.append(RR[i] - 1) RR.append RR append RR[i] - 1 RR[i] RR i 1 WL.append(WL[i] + 1) WL.append WL append WL[i] + 1 WL[i] WL i 1 RR.append(RR[i]) RR.append RR append RR[i] RR i MM = N MM N for i in range(0, N + 1):
    MM = min(MM, (max(WL[i], RR[i]))) i range(0, N + 1) range 0 N + 1 N 1 MM = min(MM, (max(WL[i], RR[i]))) MM min(MM, (max(WL[i], RR[i]))) min MM max(WL[i], RR[i]) max WL[i] WL i RR[i] RR i print(MM) print MM C = input() input() C MM = N N MM MM = min(MM, (max(WL[i], RR[i]))) min(MM, (max(WL[i], RR[i]))) MM N = int(input()) int(input()) N WL = [0] [0] WL RR = [C.count('R')] [C.count('R')] RR
N = int(input())
C = input()

WL = [0]
RR = [C.count('R')]

for i in range(0, N):
    if C[i] == 'R':
        WL.append(WL[i])
        RR.append(RR[i] - 1)
    else:
        WL.append(WL[i] + 1)
        RR.append(RR[i])

MM = N
for i in range(0, N + 1):
    MM = min(MM, (max(WL[i], RR[i])))
print(MM)