n = int(input())
s = input()
res = 0
tem = s.find('WR')
if tem == -1:
    print(res)
else:
    i, j = 0, len(s)-1
    while i<j:
        while i < j and s[i] != 'W': i+=1
        while i < j and s[j] != 'R':j -= 1
        if s[i] == 'W' and s[j] == 'R':
            res += 1
            i += 1
            j -= 1
    print(res)
 n = int(input()) n int(input()) int input() input s = input() s input() input res = 0 res 0 tem = s.find('WR') tem s.find('WR') s.find s find 'WR' if tem == -1:
    print(res)
else:
    i, j = 0, len(s)-1
    while i<j:
        while i < j and s[i] != 'W': i+=1
        while i < j and s[j] != 'R':j -= 1
        if s[i] == 'W' and s[j] == 'R':
            res += 1
            i += 1
            j -= 1
    print(res) tem == -1 tem -1 print(res) print res i, j = 0, len(s)-1 i 0 j len(s)-1 len(s) len s 1 while i<j:
        while i < j and s[i] != 'W': i+=1
        while i < j and s[j] != 'R':j -= 1
        if s[i] == 'W' and s[j] == 'R':
            res += 1
            i += 1
            j -= 1
     i<j i j while i < j and s[i] != 'W': i+=1
         i < j and s[i] != 'W' i < j i j s[i] != 'W' s[i] s i 'W' while i < j and s[j] != 'R':j -= 1
         i < j and s[j] != 'R' i < j i j s[j] != 'R' s[j] s j 'R' if s[i] == 'W' and s[j] == 'R':
            res += 1
            i += 1
            j -= 1
     s[i] == 'W' and s[j] == 'R' s[i] == 'W' s[i] s i 'W' s[j] == 'R' s[j] s j 'R' res += 1 res 1 i += 1 i 1 j -= 1 j 1 print(res) print res n = int(input()) int(input()) n i, j = 0, len(s)-1 0 i res += 1 1 res j -= 1 1 j j = 0, len(s)-1 len(s)-1 j s = input() input() s res = 0 0 res tem = s.find('WR') s.find('WR') tem i += 1 1 i
n = int(input())
s = input()
res = 0
tem = s.find('WR')
if tem == -1:
    print(res)
else:
    i, j = 0, len(s)-1
    while i<j:
        while i < j and s[i] != 'W': i+=1
        while i < j and s[j] != 'R':j -= 1
        if s[i] == 'W' and s[j] == 'R':
            res += 1
            i += 1
            j -= 1
    print(res)

