from sys import stdin
rs = stdin.readline
ri = lambda : int(rs())
ril = lambda : list(map(int, rs().split()))

def main():
    N = ri()
    c = rs()
    x = 0
    y = c.count('R')

    for e in c:
        if x == y:
            break
        elif e == 'W':
            x += 1
        else:
            y -= 1

    print(y)

if __name__ == '__main__':
    main() from sys import stdin rs = stdin.readline rs stdin.readline stdin readline ri = lambda : int(rs()) ri lambda : int(rs()) int(rs()) int rs() rs ril = lambda : list(map(int, rs().split())) ril lambda : list(map(int, rs().split())) list(map(int, rs().split())) list map(int, rs().split()) map int rs().split() ().split () rs split def main():
    N = ri()
    c = rs()
    x = 0
    y = c.count('R')

    for e in c:
        if x == y:
            break
        elif e == 'W':
            x += 1
        else:
            y -= 1

    print(y) main N = ri() N ri() ri c = rs() c rs() rs x = 0 x 0 y = c.count('R') y c.count('R') c.count c count 'R' for e in c:
        if x == y:
            break
        elif e == 'W':
            x += 1
        else:
            y -= 1

     e c if x == y:
            break
        elif e == 'W':
            x += 1
        else:
            y -= 1

     x == y x y break elif e == 'W':
            x += 1
         e == 'W' e 'W' x += 1 x 1 y -= 1 y 1 print(y) print y if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main rs = stdin.readline stdin.readline rs ri = lambda : int(rs()) lambda : int(rs()) ri ril = lambda : list(map(int, rs().split())) lambda : list(map(int, rs().split())) ril def main():
    N = ri()
    c = rs()
    x = 0
    y = c.count('R')

    for e in c:
        if x == y:
            break
        elif e == 'W':
            x += 1
        else:
            y -= 1

    print(y) def main():
    N = ri()
    c = rs()
    x = 0
    y = c.count('R')

    for e in c:
        if x == y:
            break
        elif e == 'W':
            x += 1
        else:
            y -= 1

    print(y) main
from sys import stdin
rs = stdin.readline
ri = lambda : int(rs())
ril = lambda : list(map(int, rs().split()))

def main():
    N = ri()
    c = rs()
    x = 0
    y = c.count('R')

    for e in c:
        if x == y:
            break
        elif e == 'W':
            x += 1
        else:
            y -= 1

    print(y)

if __name__ == '__main__':
    main()
