N = int(input())
c = input()
c = list(c)
t = True

i = 0
j = N - 1
count = 0

while t:
	if c[i] == "R":
		i += 1
	elif c[j] == "W":
		j -= 1
	elif c[i] == "W" and c[j] == "R":
		c[i] = "R"
		c[j] = "W"
		count += 1	
	if i >= j:
		t = False
		break
print(count) N = int(input()) N int(input()) int input() input c = input() c input() input c = list(c) c list(c) list c t = True t True i = 0 i 0 j = N - 1 j N - 1 N 1 count = 0 count 0 while t:
	if c[i] == "R":
		i += 1
	elif c[j] == "W":
		j -= 1
	elif c[i] == "W" and c[j] == "R":
		c[i] = "R"
		c[j] = "W"
		count += 1	
	if i >= j:
		t = False
		break t if c[i] == "R":
		i += 1
	elif c[j] == "W":
		j -= 1
	elif c[i] == "W" and c[j] == "R":
		c[i] = "R"
		c[j] = "W"
		count += 1	
	 c[i] == "R" c[i] c i "R" i += 1 i 1 elif c[j] == "W":
		j -= 1
	 c[j] == "W" c[j] c j "W" j -= 1 j 1 elif c[i] == "W" and c[j] == "R":
		c[i] = "R"
		c[j] = "W"
		count += 1	
	 c[i] == "W" and c[j] == "R" c[i] == "W" c[i] c i "W" c[j] == "R" c[j] c j "R" c[i] = "R" c[i] c i "R" c[j] = "W" c[j] c j "W" count += 1 count 1 if i >= j:
		t = False
		break i >= j i j t = False t False break print(count) print count c = input() input() c N = int(input()) int(input()) N c = list(c) list(c) c t = True True t t = False False t count += 1 1 count j = N - 1 N - 1 j j -= 1 1 j count = 0 0 count i += 1 1 i i = 0 0 i
N = int(input())
c = input()
c = list(c)
t = True

i = 0
j = N - 1
count = 0

while t:
	if c[i] == "R":
		i += 1
	elif c[j] == "W":
		j -= 1
	elif c[i] == "W" and c[j] == "R":
		c[i] = "R"
		c[j] = "W"
		count += 1	
	if i >= j:
		t = False
		break
print(count)
