import sys
import math
sys.setrecursionlimit(500000)
INF = float('inf')

def main():
    n = int(input())
    c = input()
    red_stones = c.count('R')
    return c[red_stones:].count('R')

if __name__ == '__main__':
    print(main()) import sys sys import math math sys.setrecursionlimit(500000) sys.setrecursionlimit sys setrecursionlimit 500000 INF = float('inf') INF float('inf') float 'inf' def main():
    n = int(input())
    c = input()
    red_stones = c.count('R')
    return c[red_stones:].count('R') main n = int(input()) n int(input()) int input() input c = input() c input() input red_stones = c.count('R') red_stones c.count('R') c.count c count 'R' return c[red_stones:].count('R') c[red_stones:].count('R') [red_stones:].count [red_stones:] c red_stones: red_stones count 'R' if __name__ == '__main__':
    print(main()) __name__ == '__main__' __name__ '__main__' print(main()) print main() main INF = float('inf') float('inf') INF def main():
    n = int(input())
    c = input()
    red_stones = c.count('R')
    return c[red_stones:].count('R') def main():
    n = int(input())
    c = input()
    red_stones = c.count('R')
    return c[red_stones:].count('R') main
import sys
import math
sys.setrecursionlimit(500000)
INF = float('inf')

def main():
    n = int(input())
    c = input()
    red_stones = c.count('R')
    return c[red_stones:].count('R')

if __name__ == '__main__':
    print(main())
