import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 9)

def main():
    N = int(input())
    c = list(input())[:-1]
    # bad_pairs = []
    w_count = 0
    r_count = 0
    for i in range(N):
        if c[i] == 'W':
            w_count += 1
        else:
            r_count += 1
        # if c[i] == 'W' and i < N - 1 and c[i + 1] == 'R':
        #     bad_pairs.append({ 'W': i, 'R': i + 1 })
    # if len(bad_pairs) == 0:
    #     print(0)
    #     exit(0)
    if w_count == N or r_count == N:
        print(0)
        exit(0)
    no_exchange = 0
    for i in range(r_count):
        if c[i] == 'R':
            no_exchange += 1
    # print(no_exchange, w_count, r_count)
    print(r_count - no_exchange)

if __name__ == '__main__':
    main() import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline sys.setrecursionlimit(10 ** 9) sys.setrecursionlimit sys setrecursionlimit 10 ** 9 10 9 def main():
    N = int(input())
    c = list(input())[:-1]
    # bad_pairs = []
    w_count = 0
    r_count = 0
    for i in range(N):
        if c[i] == 'W':
            w_count += 1
        else:
            r_count += 1
        # if c[i] == 'W' and i < N - 1 and c[i + 1] == 'R':
        #     bad_pairs.append({ 'W': i, 'R': i + 1 })
    # if len(bad_pairs) == 0:
    #     print(0)
    #     exit(0)
    if w_count == N or r_count == N:
        print(0)
        exit(0)
    no_exchange = 0
    for i in range(r_count):
        if c[i] == 'R':
            no_exchange += 1
    # print(no_exchange, w_count, r_count)
    print(r_count - no_exchange) main N = int(input()) N int(input()) int input() input c = list(input())[:-1] c list(input())[:-1] (input()) list input() input :-1 -1 w_count = 0 w_count 0 r_count = 0 r_count 0 for i in range(N):
        if c[i] == 'W':
            w_count += 1
        else:
            r_count += 1
        # if c[i] == 'W' and i < N - 1 and c[i + 1] == 'R':
        #     bad_pairs.append({ 'W': i, 'R': i + 1 })
    # if len(bad_pairs) == 0:
    #     print(0)
    #     exit(0)
     i range(N) range N if c[i] == 'W':
            w_count += 1
        else:
            r_count += 1
        # if c[i] == 'W' and i < N - 1 and c[i + 1] == 'R':
        #     bad_pairs.append({ 'W': i, 'R': i + 1 })
    # if len(bad_pairs) == 0:
    #     print(0)
    #     exit(0)
     c[i] == 'W' c[i] c i 'W' w_count += 1 w_count 1 r_count += 1 r_count 1 if w_count == N or r_count == N:
        print(0)
        exit(0)
     w_count == N or r_count == N w_count == N w_count N r_count == N r_count N print(0) print 0 exit(0) exit 0 no_exchange = 0 no_exchange 0 for i in range(r_count):
        if c[i] == 'R':
            no_exchange += 1
    # print(no_exchange, w_count, r_count)
     i range(r_count) range r_count if c[i] == 'R':
            no_exchange += 1
    # print(no_exchange, w_count, r_count)
     c[i] == 'R' c[i] c i 'R' no_exchange += 1 no_exchange 1 print(r_count - no_exchange) print r_count - no_exchange r_count no_exchange if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main input = sys.stdin.readline sys.stdin.readline input def main():
    N = int(input())
    c = list(input())[:-1]
    # bad_pairs = []
    w_count = 0
    r_count = 0
    for i in range(N):
        if c[i] == 'W':
            w_count += 1
        else:
            r_count += 1
        # if c[i] == 'W' and i < N - 1 and c[i + 1] == 'R':
        #     bad_pairs.append({ 'W': i, 'R': i + 1 })
    # if len(bad_pairs) == 0:
    #     print(0)
    #     exit(0)
    if w_count == N or r_count == N:
        print(0)
        exit(0)
    no_exchange = 0
    for i in range(r_count):
        if c[i] == 'R':
            no_exchange += 1
    # print(no_exchange, w_count, r_count)
    print(r_count - no_exchange) def main():
    N = int(input())
    c = list(input())[:-1]
    # bad_pairs = []
    w_count = 0
    r_count = 0
    for i in range(N):
        if c[i] == 'W':
            w_count += 1
        else:
            r_count += 1
        # if c[i] == 'W' and i < N - 1 and c[i + 1] == 'R':
        #     bad_pairs.append({ 'W': i, 'R': i + 1 })
    # if len(bad_pairs) == 0:
    #     print(0)
    #     exit(0)
    if w_count == N or r_count == N:
        print(0)
        exit(0)
    no_exchange = 0
    for i in range(r_count):
        if c[i] == 'R':
            no_exchange += 1
    # print(no_exchange, w_count, r_count)
    print(r_count - no_exchange) main
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 9)

def main():
    N = int(input())
    c = list(input())[:-1]
    # bad_pairs = []
    w_count = 0
    r_count = 0
    for i in range(N):
        if c[i] == 'W':
            w_count += 1
        else:
            r_count += 1
        # if c[i] == 'W' and i < N - 1 and c[i + 1] == 'R':
        #     bad_pairs.append({ 'W': i, 'R': i + 1 })
    # if len(bad_pairs) == 0:
    #     print(0)
    #     exit(0)
    if w_count == N or r_count == N:
        print(0)
        exit(0)
    no_exchange = 0
    for i in range(r_count):
        if c[i] == 'R':
            no_exchange += 1
    # print(no_exchange, w_count, r_count)
    print(r_count - no_exchange)

if __name__ == '__main__':
    main()
