import sys
from io import StringIO
import unittest

def resolve():
    N = map(int, input().split())
    input_str = input()
    r_cnt=0;
    for s in input_str:
        # print(s)
        if s =='R':
            r_cnt+=1
    ans = 0
    for i in range(r_cnt):
        if input_str[i] == 'W':
            ans+=1
    print(ans)


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """4
WWRR"""
        output = """2"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """2
RR"""
        output = """0"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """8
WRWWRWRR"""
        output = """3"""
        self.assertIO(input, output)


if __name__ == "__main__":
    resolve() import sys sys from io import StringIO import unittest unittest def resolve():
    N = map(int, input().split())
    input_str = input()
    r_cnt=0;
    for s in input_str:
        # print(s)
        if s =='R':
            r_cnt+=1
    ans = 0
    for i in range(r_cnt):
        if input_str[i] == 'W':
            ans+=1
    print(ans) resolve N = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split input_str = input() input_str input() input r_cnt=0 r_cnt 0 for s in input_str:
        # print(s)
        if s =='R':
            r_cnt+=1
     s input_str if s =='R':
            r_cnt+=1
     s =='R' s 'R' r_cnt+=1 r_cnt 1 ans = 0 ans 0 for i in range(r_cnt):
        if input_str[i] == 'W':
            ans+=1
     i range(r_cnt) range r_cnt if input_str[i] == 'W':
            ans+=1
     input_str[i] == 'W' input_str[i] input_str i 'W' ans+=1 ans 1 print(ans) print ans class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """4
WWRR"""
        output = """2"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """2
RR"""
        output = """0"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """8
WRWWRWRR"""
        output = """3"""
        self.assertIO(input, output) TestClass def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

     assertIO stdout, stdin = sys.stdout, sys.stdin stdout sys.stdout sys stdout stdin sys.stdin sys stdin sys.stdout, sys.stdin = StringIO(), StringIO(input) sys.stdout sys stdout StringIO() StringIO sys.stdin sys stdin StringIO(input) StringIO input resolve() resolve sys.stdout.seek(0) sys.stdout.seek sys.stdout sys stdout seek 0 out = sys.stdout.read()[:-1] out sys.stdout.read()[:-1] sys.stdout.read() sys.stdout.read sys.stdout sys stdout read :-1 -1 sys.stdout, sys.stdin = stdout, stdin sys.stdout sys stdout stdout sys.stdin sys stdin stdin self.assertEqual(out, output) self.assertEqual self assertEqual out output self self input input output output def test_入力例_1(self):
        input = """4
WWRR"""
        output = """2"""
        self.assertIO(input, output)

     test_入力例_1 input = """4
WWRR""" input """4
WWRR""" output = """2""" output """2""" self.assertIO(input, output) self.assertIO self assertIO input output self self def test_入力例_2(self):
        input = """2
RR"""
        output = """0"""
        self.assertIO(input, output)

     test_入力例_2 input = """2
RR""" input """2
RR""" output = """0""" output """0""" self.assertIO(input, output) self.assertIO self assertIO input output self self def test_入力例_3(self):
        input = """8
WRWWRWRR"""
        output = """3"""
        self.assertIO(input, output) test_入力例_3 input = """8
WRWWRWRR""" input """8
WRWWRWRR""" output = """3""" output """3""" self.assertIO(input, output) self.assertIO self assertIO input output self self unittest.TestCase unittest TestCase if __name__ == "__main__":
    resolve() __name__ == "__main__" __name__ "__main__" resolve() resolve def resolve():
    N = map(int, input().split())
    input_str = input()
    r_cnt=0;
    for s in input_str:
        # print(s)
        if s =='R':
            r_cnt+=1
    ans = 0
    for i in range(r_cnt):
        if input_str[i] == 'W':
            ans+=1
    print(ans) def resolve():
    N = map(int, input().split())
    input_str = input()
    r_cnt=0;
    for s in input_str:
        # print(s)
        if s =='R':
            r_cnt+=1
    ans = 0
    for i in range(r_cnt):
        if input_str[i] == 'W':
            ans+=1
    print(ans) resolve class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """4
WWRR"""
        output = """2"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """2
RR"""
        output = """0"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """8
WRWWRWRR"""
        output = """3"""
        self.assertIO(input, output) class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """4
WWRR"""
        output = """2"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """2
RR"""
        output = """0"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """8
WRWWRWRR"""
        output = """3"""
        self.assertIO(input, output) TestClass
import sys
from io import StringIO
import unittest

def resolve():
    N = map(int, input().split())
    input_str = input()
    r_cnt=0;
    for s in input_str:
        # print(s)
        if s =='R':
            r_cnt+=1
    ans = 0
    for i in range(r_cnt):
        if input_str[i] == 'W':
            ans+=1
    print(ans)


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """4
WWRR"""
        output = """2"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """2
RR"""
        output = """0"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """8
WRWWRWRR"""
        output = """3"""
        self.assertIO(input, output)


if __name__ == "__main__":
    resolve()
