#!/usr/bin/env python3


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    N = int(input())
    C = list(input())
    Rc = len(list(filter(lambda x:x=="R",C)))
    Wc = len(C) - Rc
    c = 0
    for i in range(Rc):
        if C[i] == "W":
            c+=1
    # print(Rc)
    # print(Wc)
    print(c)
    pass

if __name__ == '__main__':
    main() def main():
    N = int(input())
    C = list(input())
    Rc = len(list(filter(lambda x:x=="R",C)))
    Wc = len(C) - Rc
    c = 0
    for i in range(Rc):
        if C[i] == "W":
            c+=1
    # print(Rc)
    # print(Wc)
    print(c)
    pass main N = int(input()) N int(input()) int input() input C = list(input()) C list(input()) list input() input Rc = len(list(filter(lambda x:x=="R",C))) Rc len(list(filter(lambda x:x=="R",C))) len list(filter(lambda x:x=="R",C)) list filter(lambda x:x=="R",C) filter lambda x:x=="R" x=="R" x "R" x C Wc = len(C) - Rc Wc len(C) - Rc len(C) len C Rc c = 0 c 0 for i in range(Rc):
        if C[i] == "W":
            c+=1
    # print(Rc)
    # print(Wc)
     i range(Rc) range Rc if C[i] == "W":
            c+=1
    # print(Rc)
    # print(Wc)
     C[i] == "W" C[i] C i "W" c+=1 c 1 print(c) print c if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    N = int(input())
    C = list(input())
    Rc = len(list(filter(lambda x:x=="R",C)))
    Wc = len(C) - Rc
    c = 0
    for i in range(Rc):
        if C[i] == "W":
            c+=1
    # print(Rc)
    # print(Wc)
    print(c)
    pass def main():
    N = int(input())
    C = list(input())
    Rc = len(list(filter(lambda x:x=="R",C)))
    Wc = len(C) - Rc
    c = 0
    for i in range(Rc):
        if C[i] == "W":
            c+=1
    # print(Rc)
    # print(Wc)
    print(c)
    pass main
#!/usr/bin/env python3


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    N = int(input())
    C = list(input())
    Rc = len(list(filter(lambda x:x=="R",C)))
    Wc = len(C) - Rc
    c = 0
    for i in range(Rc):
        if C[i] == "W":
            c+=1
    # print(Rc)
    # print(Wc)
    print(c)
    pass

if __name__ == '__main__':
    main()
