def main():

    n = int(eval(input()))

    s = eval(input())



    wcount = s.count("W")

    rcount = s.count("R")



    ans = 0



    for i in range(rcount):

        if s[i] == "W":

            ans+=1

    print(ans)





if __name__ == "__main__":

    main()
def main():

    n = int(eval(input()))

    s = eval(input())

    rcount = s.count('R')

    diff = s[0:rcount].count("W")



    print(diff)









if __name__ == "__main__":

    main()
def main():
    n = int(eval(input()))
    s = eval(input())
    wcount = s.count("W")
    rcount = s.count("R")
    ans = 0
    for i in range(rcount):
        if s[i] == "W":
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()

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


if __name__ == "__main__":
    main()

-    wcount = s.count("W") -    ans = 0 -    for i in range(rcount): -        if s[i] == "W": -            ans += 1 -    print(ans) +    diff = s[0:rcount].count("W") +    print(diff)