def main():
    n = int(input())
    s = input()
    rcount = s.count('R')
    diff = s[0:rcount].count("W")

    print(diff)




if __name__ == "__main__":
    main() def main():
    n = int(input())
    s = input()
    rcount = s.count('R')
    diff = s[0:rcount].count("W")

    print(diff) main n = int(input()) n int(input()) int input() input s = input() s input() input rcount = s.count('R') rcount s.count('R') s.count s count 'R' diff = s[0:rcount].count("W") diff s[0:rcount].count("W") [0:rcount].count [0:rcount] s 0:rcount 0 rcount count "W" print(diff) print diff if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    n = int(input())
    s = input()
    rcount = s.count('R')
    diff = s[0:rcount].count("W")

    print(diff) def main():
    n = int(input())
    s = input()
    rcount = s.count('R')
    diff = s[0:rcount].count("W")

    print(diff) main
def main():
    n = int(input())
    s = input()
    rcount = s.count('R')
    diff = s[0:rcount].count("W")

    print(diff)




if __name__ == "__main__":
    main()