class Alter:
    def __init__(self, N, C):
        self.N = N
        self.C = C

        whites = 0
        for c in C:
            if c == "W":
                whites += 1
        self.white_count = whites
        self.red_count = N - whites

    def solve(self):
        result = 0
        if self.white_count == self.red_count:
            for i in range(self.red_count):
                if self.C[i] == "W":
                    result += 1
            print(result)
        elif self.white_count > self.red_count:
            for i in range(self.red_count):
                if self.C[i] == "W":
                    result += 1
            print(result)
        else:
            for i in range(self.white_count):
                w_i = self.N - i - 1
                if self.C[w_i] == "R":
                    result += 1
            print(result)

N = int(input())

c_line = input()
C = [None] * N
for i, c in enumerate(c_line):
    C[i] = c

alter = Alter(N, C)
alter.solve() class Alter:
    def __init__(self, N, C):
        self.N = N
        self.C = C

        whites = 0
        for c in C:
            if c == "W":
                whites += 1
        self.white_count = whites
        self.red_count = N - whites

    def solve(self):
        result = 0
        if self.white_count == self.red_count:
            for i in range(self.red_count):
                if self.C[i] == "W":
                    result += 1
            print(result)
        elif self.white_count > self.red_count:
            for i in range(self.red_count):
                if self.C[i] == "W":
                    result += 1
            print(result)
        else:
            for i in range(self.white_count):
                w_i = self.N - i - 1
                if self.C[w_i] == "R":
                    result += 1
            print(result) Alter def __init__(self, N, C):
        self.N = N
        self.C = C

        whites = 0
        for c in C:
            if c == "W":
                whites += 1
        self.white_count = whites
        self.red_count = N - whites

     __init__ self.N = N self.N self N N self.C = C self.C self C C whites = 0 whites 0 for c in C:
            if c == "W":
                whites += 1
         c C if c == "W":
                whites += 1
         c == "W" c "W" whites += 1 whites 1 self.white_count = whites self.white_count self white_count whites self.red_count = N - whites self.red_count self red_count N - whites N whites self self N N C C def solve(self):
        result = 0
        if self.white_count == self.red_count:
            for i in range(self.red_count):
                if self.C[i] == "W":
                    result += 1
            print(result)
        elif self.white_count > self.red_count:
            for i in range(self.red_count):
                if self.C[i] == "W":
                    result += 1
            print(result)
        else:
            for i in range(self.white_count):
                w_i = self.N - i - 1
                if self.C[w_i] == "R":
                    result += 1
            print(result) solve result = 0 result 0 if self.white_count == self.red_count:
            for i in range(self.red_count):
                if self.C[i] == "W":
                    result += 1
            print(result)
        elif self.white_count > self.red_count:
            for i in range(self.red_count):
                if self.C[i] == "W":
                    result += 1
            print(result)
        else:
            for i in range(self.white_count):
                w_i = self.N - i - 1
                if self.C[w_i] == "R":
                    result += 1
            print(result) self.white_count == self.red_count self.white_count self white_count self.red_count self red_count for i in range(self.red_count):
                if self.C[i] == "W":
                    result += 1
             i range(self.red_count) range self.red_count self red_count if self.C[i] == "W":
                    result += 1
             self.C[i] == "W" self.C[i] self.C self C i "W" result += 1 result 1 print(result) print result elif self.white_count > self.red_count:
            for i in range(self.red_count):
                if self.C[i] == "W":
                    result += 1
            print(result)
         self.white_count > self.red_count self.white_count self white_count self.red_count self red_count for i in range(self.red_count):
                if self.C[i] == "W":
                    result += 1
             i range(self.red_count) range self.red_count self red_count if self.C[i] == "W":
                    result += 1
             self.C[i] == "W" self.C[i] self.C self C i "W" result += 1 result 1 print(result) print result for i in range(self.white_count):
                w_i = self.N - i - 1
                if self.C[w_i] == "R":
                    result += 1
             i range(self.white_count) range self.white_count self white_count w_i = self.N - i - 1 w_i self.N - i - 1 self.N - i self.N self N i 1 if self.C[w_i] == "R":
                    result += 1
             self.C[w_i] == "R" self.C[w_i] self.C self C w_i "R" result += 1 result 1 print(result) print result self self N = int(input()) N int(input()) int input() input c_line = input() c_line input() input C = [None] * N C [None] * N [None] None N for i, c in enumerate(c_line):
    C[i] = c i c enumerate(c_line) enumerate c_line C[i] = c C[i] C i c alter = Alter(N, C) alter Alter(N, C) Alter N C alter.solve() alter.solve alter solve c_line = input() input() c_line alter = Alter(N, C) Alter(N, C) alter class Alter:
    def __init__(self, N, C):
        self.N = N
        self.C = C

        whites = 0
        for c in C:
            if c == "W":
                whites += 1
        self.white_count = whites
        self.red_count = N - whites

    def solve(self):
        result = 0
        if self.white_count == self.red_count:
            for i in range(self.red_count):
                if self.C[i] == "W":
                    result += 1
            print(result)
        elif self.white_count > self.red_count:
            for i in range(self.red_count):
                if self.C[i] == "W":
                    result += 1
            print(result)
        else:
            for i in range(self.white_count):
                w_i = self.N - i - 1
                if self.C[w_i] == "R":
                    result += 1
            print(result) class Alter:
    def __init__(self, N, C):
        self.N = N
        self.C = C

        whites = 0
        for c in C:
            if c == "W":
                whites += 1
        self.white_count = whites
        self.red_count = N - whites

    def solve(self):
        result = 0
        if self.white_count == self.red_count:
            for i in range(self.red_count):
                if self.C[i] == "W":
                    result += 1
            print(result)
        elif self.white_count > self.red_count:
            for i in range(self.red_count):
                if self.C[i] == "W":
                    result += 1
            print(result)
        else:
            for i in range(self.white_count):
                w_i = self.N - i - 1
                if self.C[w_i] == "R":
                    result += 1
            print(result) Alter C = [None] * N [None] * N C N = int(input()) int(input()) N
class Alter:
    def __init__(self, N, C):
        self.N = N
        self.C = C

        whites = 0
        for c in C:
            if c == "W":
                whites += 1
        self.white_count = whites
        self.red_count = N - whites

    def solve(self):
        result = 0
        if self.white_count == self.red_count:
            for i in range(self.red_count):
                if self.C[i] == "W":
                    result += 1
            print(result)
        elif self.white_count > self.red_count:
            for i in range(self.red_count):
                if self.C[i] == "W":
                    result += 1
            print(result)
        else:
            for i in range(self.white_count):
                w_i = self.N - i - 1
                if self.C[w_i] == "R":
                    result += 1
            print(result)

N = int(input())

c_line = input()
C = [None] * N
for i, c in enumerate(c_line):
    C[i] = c

alter = Alter(N, C)
alter.solve()
