def main():

    eval(input())  # n

    stones = eval(input())

    white_counter = []

    white_stones = 0

    red_stones = 0

    for color in stones:

        if color == 'W':

            white_stones += 1

        else:

            red_stones += 1

        white_counter.append(white_stones)



    if red_stones == 0:

        print((0))

    else:

        print((white_counter[red_stones - 1]))





if __name__ == '__main__':

    main()

def main():

    eval(input())  # n

    stones = eval(input())

    reds = stones.count('R')

    print((stones[:reds].count('W')))



if __name__ == '__main__':

    main()

def main():
    eval(input())  # n
    stones = eval(input())
    white_counter = []
    white_stones = 0
    red_stones = 0
    for color in stones:
        if color == "W":
            white_stones += 1
        else:
            red_stones += 1
        white_counter.append(white_stones)
    if red_stones == 0:
        print((0))
    else:
        print((white_counter[red_stones - 1]))


if __name__ == "__main__":
    main()

def main():
    eval(input())  # n
    stones = eval(input())
    reds = stones.count("R")
    print((stones[:reds].count("W")))


if __name__ == "__main__":
    main()

-    white_counter = [] -    white_stones = 0 -    red_stones = 0 -    for color in stones: -        if color == "W": -            white_stones += 1 -        else: -            red_stones += 1 -        white_counter.append(white_stones) -    if red_stones == 0: -        print((0)) -    else: -        print((white_counter[red_stones - 1])) +    reds = stones.count("R") +    print((stones[:reds].count("W")))