import sys
def input(): return sys.stdin.readline().rstrip()
from collections import Counter
def main():
    n = int(input())
    C = input()
    C_cunt = Counter(C)
    cunt_r = C_cunt['R']
    ans = 0
    for i in range(cunt_r):
        if C[i] == 'W':
            ans += 1
    print(ans)

if __name__=='__main__':
    main() import sys sys def input(): return sys.stdin.readline().rstrip() input from collections import Counter def main():
    n = int(input())
    C = input()
    C_cunt = Counter(C)
    cunt_r = C_cunt['R']
    ans = 0
    for i in range(cunt_r):
        if C[i] == 'W':
            ans += 1
    print(ans) main n = int(input()) n int(input()) int input() input C = input() C input() input C_cunt = Counter(C) C_cunt Counter(C) Counter C cunt_r = C_cunt['R'] cunt_r C_cunt['R'] C_cunt 'R' ans = 0 ans 0 for i in range(cunt_r):
        if C[i] == 'W':
            ans += 1
     i range(cunt_r) range cunt_r if C[i] == 'W':
            ans += 1
     C[i] == 'W' C[i] C i 'W' ans += 1 ans 1 print(ans) print ans if __name__=='__main__':
    main() __name__=='__main__' __name__ '__main__' main() main def main():
    n = int(input())
    C = input()
    C_cunt = Counter(C)
    cunt_r = C_cunt['R']
    ans = 0
    for i in range(cunt_r):
        if C[i] == 'W':
            ans += 1
    print(ans) def main():
    n = int(input())
    C = input()
    C_cunt = Counter(C)
    cunt_r = C_cunt['R']
    ans = 0
    for i in range(cunt_r):
        if C[i] == 'W':
            ans += 1
    print(ans) main def input(): return sys.stdin.readline().rstrip() def input(): return sys.stdin.readline().rstrip() input
import sys
def input(): return sys.stdin.readline().rstrip()
from collections import Counter
def main():
    n = int(input())
    C = input()
    C_cunt = Counter(C)
    cunt_r = C_cunt['R']
    ans = 0
    for i in range(cunt_r):
        if C[i] == 'W':
            ans += 1
    print(ans)

if __name__=='__main__':
    main()