def main():
    n = int(input())
    C = input()

    rc = C.count('R')
    rhc = C[:rc].count('R')
    print(rc - rhc)


if __name__ == '__main__':
    main() def main():
    n = int(input())
    C = input()

    rc = C.count('R')
    rhc = C[:rc].count('R')
    print(rc - rhc) main n = int(input()) n int(input()) int input() input C = input() C input() input rc = C.count('R') rc C.count('R') C.count C count 'R' rhc = C[:rc].count('R') rhc C[:rc].count('R') [:rc].count [:rc] C :rc rc count 'R' print(rc - rhc) print rc - rhc rc rhc if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    n = int(input())
    C = input()

    rc = C.count('R')
    rhc = C[:rc].count('R')
    print(rc - rhc) def main():
    n = int(input())
    C = input()

    rc = C.count('R')
    rhc = C[:rc].count('R')
    print(rc - rhc) main
def main():
    n = int(input())
    C = input()

    rc = C.count('R')
    rhc = C[:rc].count('R')
    print(rc - rhc)


if __name__ == '__main__':
    main()
