# import sys

# input = sys.stdin.readline

# import re

import collections



def main():

    n = int(eval(input()))

    s = eval(input())

    sc = collections.Counter(s)

    # 半分ずつの場合

    if sc['W'] == sc['R']:

        # 右側のRをカウント

        print((s[n//2:].count('R')))

        exit()

    print((s[:sc['R']].count('W')))





def input_list():

    return list(map(int, input().split()))





def input_list_str():

    return list(map(str, input().split()))





if __name__ == '__main__':

    main()



# import sys

# input = sys.stdin.readline

import collections



def main():

    n = int(eval(input()))

    s = eval(input())

    a_list = []

    for i in range(n):

        if s[i] == "W":

            a_list.append(0)

        else:

            a_list.append(1)

    r_count = sum(a_list)

    print((r_count - sum(a_list[0:r_count])))





def input_list():

    return list(map(int, input().split()))





def input_list_str():

    return list(map(str, input().split()))





if __name__ == "__main__":

    main()

# import sys
# input = sys.stdin.readline
# import re
import collections


def main():
    n = int(eval(input()))
    s = eval(input())
    sc = collections.Counter(s)
    # 半分ずつの場合
    if sc["W"] == sc["R"]:
        # 右側のRをカウント
        print((s[n // 2 :].count("R")))
        exit()
    print((s[: sc["R"]].count("W")))


def input_list():
    return list(map(int, input().split()))


def input_list_str():
    return list(map(str, input().split()))


if __name__ == "__main__":
    main()

# import sys
# input = sys.stdin.readline
import collections


def main():
    n = int(eval(input()))
    s = eval(input())
    a_list = []
    for i in range(n):
        if s[i] == "W":
            a_list.append(0)
        else:
            a_list.append(1)
    r_count = sum(a_list)
    print((r_count - sum(a_list[0:r_count])))


def input_list():
    return list(map(int, input().split()))


def input_list_str():
    return list(map(str, input().split()))


if __name__ == "__main__":
    main()

-# import re -    sc = collections.Counter(s) -    # 半分ずつの場合 -    if sc["W"] == sc["R"]: -        # 右側のRをカウント -        print((s[n // 2 :].count("R"))) -        exit() -    print((s[: sc["R"]].count("W"))) +    a_list = [] +    for i in range(n): +        if s[i] == "W": +            a_list.append(0) +        else: +            a_list.append(1) +    r_count = sum(a_list) +    print((r_count - sum(a_list[0:r_count])))