if __name__ == '__main__':

    n = int(input())
    A = list(input())

    white = A.count("W")
    red   = A.count("R")

    #最終形を作る
    B = sorted(A)

    #現在の形と最終形との比較をする
    a = b = 0
    for w,r in zip(A,B):
        if w != r:
            if w == "W":
                a += 1
            else:
                b += 1

    #結果
    com = min(a,b)
    bg = max(a,b)
    dif = bg - com
    ans = com + dif
    print(ans) if __name__ == '__main__':

    n = int(input())
    A = list(input())

    white = A.count("W")
    red   = A.count("R")

    #最終形を作る
    B = sorted(A)

    #現在の形と最終形との比較をする
    a = b = 0
    for w,r in zip(A,B):
        if w != r:
            if w == "W":
                a += 1
            else:
                b += 1

    #結果
    com = min(a,b)
    bg = max(a,b)
    dif = bg - com
    ans = com + dif
    print(ans) __name__ == '__main__' __name__ '__main__' n = int(input()) n int(input()) int input() input A = list(input()) A list(input()) list input() input white = A.count("W") white A.count("W") A.count A count "W" red   = A.count("R") red A.count("R") A.count A count "R" B = sorted(A) B sorted(A) sorted A a = b = 0 a 0 = b = 0 b 0 for w,r in zip(A,B):
        if w != r:
            if w == "W":
                a += 1
            else:
                b += 1

    #結果
     w r zip(A,B) zip A B if w != r:
            if w == "W":
                a += 1
            else:
                b += 1

    #結果
     w != r w r if w == "W":
                a += 1
            else:
                b += 1

    #結果
     w == "W" w "W" a += 1 a 1 b += 1 b 1 com = min(a,b) com min(a,b) min a b bg = max(a,b) bg max(a,b) max a b dif = bg - com dif bg - com bg com ans = com + dif ans com + dif com dif print(ans) print ans b = 0 0 b a = b = 0 0 a com = min(a,b) min(a,b) com B = sorted(A) sorted(A) B b += 1 1 b bg = max(a,b) max(a,b) bg white = A.count("W") A.count("W") white A = list(input()) list(input()) A red   = A.count("R") A.count("R") red a += 1 1 a ans = com + dif com + dif ans n = int(input()) int(input()) n dif = bg - com bg - com dif
if __name__ == '__main__':

    n = int(input())
    A = list(input())

    white = A.count("W")
    red   = A.count("R")

    #最終形を作る
    B = sorted(A)

    #現在の形と最終形との比較をする
    a = b = 0
    for w,r in zip(A,B):
        if w != r:
            if w == "W":
                a += 1
            else:
                b += 1

    #結果
    com = min(a,b)
    bg = max(a,b)
    dif = bg - com
    ans = com + dif
    print(ans)
