import sys
from collections import Counter

input = sys.stdin.readline
N = int(input())
C = list(input().strip())

counter = Counter(C)
if len(counter) == 1:
    print(0)
else:
    red_n = counter["R"]
    ans = 0
    for i in range(N):
        if red_n <= i:
            break
        if C[i] == "W":
            ans += 1
    print(ans) import sys sys from collections import Counter input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline N = int(input()) N int(input()) int input() input C = list(input().strip()) C list(input().strip()) list input().strip() ().strip () input strip counter = Counter(C) counter Counter(C) Counter C if len(counter) == 1:
    print(0)
else:
    red_n = counter["R"]
    ans = 0
    for i in range(N):
        if red_n <= i:
            break
        if C[i] == "W":
            ans += 1
    print(ans) len(counter) == 1 len(counter) len counter 1 print(0) print 0 red_n = counter["R"] red_n counter["R"] counter "R" ans = 0 ans 0 for i in range(N):
        if red_n <= i:
            break
        if C[i] == "W":
            ans += 1
     i range(N) range N if red_n <= i:
            break
         red_n <= i red_n i break if C[i] == "W":
            ans += 1
     C[i] == "W" C[i] C i "W" ans += 1 ans 1 print(ans) print ans C = list(input().strip()) list(input().strip()) C counter = Counter(C) Counter(C) counter input = sys.stdin.readline sys.stdin.readline input red_n = counter["R"] counter["R"] red_n ans += 1 1 ans N = int(input()) int(input()) N ans = 0 0 ans
import sys
from collections import Counter

input = sys.stdin.readline
N = int(input())
C = list(input().strip())

counter = Counter(C)
if len(counter) == 1:
    print(0)
else:
    red_n = counter["R"]
    ans = 0
    for i in range(N):
        if red_n <= i:
            break
        if C[i] == "W":
            ans += 1
    print(ans)