if __name__ == '__main__':
    N = int(input())
    C = list(input())
    cnt = 0
    red_cnt = 0
    for c in C:
        if c == 'R':
            red_cnt += 1

    for i in range(red_cnt):
        if C[i] == 'W':
            for j in range(red_cnt, N):
                if C[j] == 'R':
                    C[i] = 'R'
                    C[j] = 'W'
                    cnt += 1
                    red_cnt = j+1
    print(cnt) if __name__ == '__main__':
    N = int(input())
    C = list(input())
    cnt = 0
    red_cnt = 0
    for c in C:
        if c == 'R':
            red_cnt += 1

    for i in range(red_cnt):
        if C[i] == 'W':
            for j in range(red_cnt, N):
                if C[j] == 'R':
                    C[i] = 'R'
                    C[j] = 'W'
                    cnt += 1
                    red_cnt = j+1
    print(cnt) __name__ == '__main__' __name__ '__main__' N = int(input()) N int(input()) int input() input C = list(input()) C list(input()) list input() input cnt = 0 cnt 0 red_cnt = 0 red_cnt 0 for c in C:
        if c == 'R':
            red_cnt += 1

     c C if c == 'R':
            red_cnt += 1

     c == 'R' c 'R' red_cnt += 1 red_cnt 1 for i in range(red_cnt):
        if C[i] == 'W':
            for j in range(red_cnt, N):
                if C[j] == 'R':
                    C[i] = 'R'
                    C[j] = 'W'
                    cnt += 1
                    red_cnt = j+1
     i range(red_cnt) range red_cnt if C[i] == 'W':
            for j in range(red_cnt, N):
                if C[j] == 'R':
                    C[i] = 'R'
                    C[j] = 'W'
                    cnt += 1
                    red_cnt = j+1
     C[i] == 'W' C[i] C i 'W' for j in range(red_cnt, N):
                if C[j] == 'R':
                    C[i] = 'R'
                    C[j] = 'W'
                    cnt += 1
                    red_cnt = j+1
     j range(red_cnt, N) range red_cnt N if C[j] == 'R':
                    C[i] = 'R'
                    C[j] = 'W'
                    cnt += 1
                    red_cnt = j+1
     C[j] == 'R' C[j] C j 'R' C[i] = 'R' C[i] C i 'R' C[j] = 'W' C[j] C j 'W' cnt += 1 cnt 1 red_cnt = j+1 red_cnt j+1 j 1 print(cnt) print cnt cnt = 0 0 cnt red_cnt = 0 0 red_cnt red_cnt = j+1 j+1 red_cnt red_cnt += 1 1 red_cnt N = int(input()) int(input()) N C = list(input()) list(input()) C cnt += 1 1 cnt
if __name__ == '__main__':
    N = int(input())
    C = list(input())
    cnt = 0
    red_cnt = 0
    for c in C:
        if c == 'R':
            red_cnt += 1

    for i in range(red_cnt):
        if C[i] == 'W':
            for j in range(red_cnt, N):
                if C[j] == 'R':
                    C[i] = 'R'
                    C[j] = 'W'
                    cnt += 1
                    red_cnt = j+1
    print(cnt)