def main():
    N = int(input())
    C = list(input())
    C_ = sorted(C)

    wr = rw = 0
    for i in range(len(C_)):
        if C[i] != C_[i]:
            if C[i] == "R" and C_[i] == "W":
                rw += 1
            else:
                wr += 1

    print(max(wr, rw))
    
if __name__ == "__main__":
    main() def main():
    N = int(input())
    C = list(input())
    C_ = sorted(C)

    wr = rw = 0
    for i in range(len(C_)):
        if C[i] != C_[i]:
            if C[i] == "R" and C_[i] == "W":
                rw += 1
            else:
                wr += 1

    print(max(wr, rw))
     main N = int(input()) N int(input()) int input() input C = list(input()) C list(input()) list input() input C_ = sorted(C) C_ sorted(C) sorted C wr = rw = 0 wr 0 = rw = 0 rw 0 for i in range(len(C_)):
        if C[i] != C_[i]:
            if C[i] == "R" and C_[i] == "W":
                rw += 1
            else:
                wr += 1

     i range(len(C_)) range len(C_) len C_ if C[i] != C_[i]:
            if C[i] == "R" and C_[i] == "W":
                rw += 1
            else:
                wr += 1

     C[i] != C_[i] C[i] C i C_[i] C_ i if C[i] == "R" and C_[i] == "W":
                rw += 1
            else:
                wr += 1

     C[i] == "R" and C_[i] == "W" C[i] == "R" C[i] C i "R" C_[i] == "W" C_[i] C_ i "W" rw += 1 rw 1 wr += 1 wr 1 print(max(wr, rw)) print max(wr, rw) max wr rw if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    N = int(input())
    C = list(input())
    C_ = sorted(C)

    wr = rw = 0
    for i in range(len(C_)):
        if C[i] != C_[i]:
            if C[i] == "R" and C_[i] == "W":
                rw += 1
            else:
                wr += 1

    print(max(wr, rw))
     def main():
    N = int(input())
    C = list(input())
    C_ = sorted(C)

    wr = rw = 0
    for i in range(len(C_)):
        if C[i] != C_[i]:
            if C[i] == "R" and C_[i] == "W":
                rw += 1
            else:
                wr += 1

    print(max(wr, rw))
     main
def main():
    N = int(input())
    C = list(input())
    C_ = sorted(C)

    wr = rw = 0
    for i in range(len(C_)):
        if C[i] != C_[i]:
            if C[i] == "R" and C_[i] == "W":
                rw += 1
            else:
                wr += 1

    print(max(wr, rw))
    
if __name__ == "__main__":
    main()