import bisect,collections,copy,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip.split())
def main():
    n = I()
    c = list(S())
    alldic = collections.Counter(c)
    allnum = alldic["R"]
    leftdic = collections.Counter(c[:allnum])
    leftnum = leftdic["R"]
    ans = allnum-leftnum
    print(ans)
main() import bisect,collections,copy,itertools,math,string bisect collections copy itertools math string import sys sys def I(): return int(sys.stdin.readline().rstrip()) I def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) LI def S(): return sys.stdin.readline().rstrip() S def LS(): return list(sys.stdin.readline().rstrip.split()) LS def main():
    n = I()
    c = list(S())
    alldic = collections.Counter(c)
    allnum = alldic["R"]
    leftdic = collections.Counter(c[:allnum])
    leftnum = leftdic["R"]
    ans = allnum-leftnum
    print(ans) main n = I() n I() I c = list(S()) c list(S()) list S() S alldic = collections.Counter(c) alldic collections.Counter(c) collections.Counter collections Counter c allnum = alldic["R"] allnum alldic["R"] alldic "R" leftdic = collections.Counter(c[:allnum]) leftdic collections.Counter(c[:allnum]) collections.Counter collections Counter c[:allnum] c :allnum allnum leftnum = leftdic["R"] leftnum leftdic["R"] leftdic "R" ans = allnum-leftnum ans allnum-leftnum allnum leftnum print(ans) print ans main() main def I(): return int(sys.stdin.readline().rstrip()) def I(): return int(sys.stdin.readline().rstrip()) I def main():
    n = I()
    c = list(S())
    alldic = collections.Counter(c)
    allnum = alldic["R"]
    leftdic = collections.Counter(c[:allnum])
    leftnum = leftdic["R"]
    ans = allnum-leftnum
    print(ans) def main():
    n = I()
    c = list(S())
    alldic = collections.Counter(c)
    allnum = alldic["R"]
    leftdic = collections.Counter(c[:allnum])
    leftnum = leftdic["R"]
    ans = allnum-leftnum
    print(ans) main def LS(): return list(sys.stdin.readline().rstrip.split()) def LS(): return list(sys.stdin.readline().rstrip.split()) LS def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) LI def S(): return sys.stdin.readline().rstrip() def S(): return sys.stdin.readline().rstrip() S
import bisect,collections,copy,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip.split())
def main():
    n = I()
    c = list(S())
    alldic = collections.Counter(c)
    allnum = alldic["R"]
    leftdic = collections.Counter(c[:allnum])
    leftnum = leftdic["R"]
    ans = allnum-leftnum
    print(ans)
main()