
def main():
    n = int(input())
    c = [i for i in input()]
    ans = 0
    cnt = 0
    cnt2 = 0
    for i in range(n):
        if c[i] =="R":
            cnt += 1
    for i in range(cnt):
        if c[i] == "R":
            cnt2 += 1
    ans = cnt - cnt2
    
    print(ans)


if __name__ == "__main__":
    main() def main():
    n = int(input())
    c = [i for i in input()]
    ans = 0
    cnt = 0
    cnt2 = 0
    for i in range(n):
        if c[i] =="R":
            cnt += 1
    for i in range(cnt):
        if c[i] == "R":
            cnt2 += 1
    ans = cnt - cnt2
    
    print(ans) main n = int(input()) n int(input()) int input() input i for i in input() for i in input() i input() input for i in input() i c = [i for i in input()] c [i for i in input()] ans = 0 ans 0 cnt = 0 cnt 0 cnt2 = 0 cnt2 0 for i in range(n):
        if c[i] =="R":
            cnt += 1
     i range(n) range n if c[i] =="R":
            cnt += 1
     c[i] =="R" c[i] c i "R" cnt += 1 cnt 1 for i in range(cnt):
        if c[i] == "R":
            cnt2 += 1
     i range(cnt) range cnt if c[i] == "R":
            cnt2 += 1
     c[i] == "R" c[i] c i "R" cnt2 += 1 cnt2 1 ans = cnt - cnt2 ans cnt - cnt2 cnt cnt2 print(ans) print ans if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    n = int(input())
    c = [i for i in input()]
    ans = 0
    cnt = 0
    cnt2 = 0
    for i in range(n):
        if c[i] =="R":
            cnt += 1
    for i in range(cnt):
        if c[i] == "R":
            cnt2 += 1
    ans = cnt - cnt2
    
    print(ans) def main():
    n = int(input())
    c = [i for i in input()]
    ans = 0
    cnt = 0
    cnt2 = 0
    for i in range(n):
        if c[i] =="R":
            cnt += 1
    for i in range(cnt):
        if c[i] == "R":
            cnt2 += 1
    ans = cnt - cnt2
    
    print(ans) main

def main():
    n = int(input())
    c = [i for i in input()]
    ans = 0
    cnt = 0
    cnt2 = 0
    for i in range(n):
        if c[i] =="R":
            cnt += 1
    for i in range(cnt):
        if c[i] == "R":
            cnt2 += 1
    ans = cnt - cnt2
    
    print(ans)


if __name__ == "__main__":
    main()