N = int(input())
s = str(input())

a = 0
b = 0

for i in range(N):
    if s[i] == 'R':
        a = a + 1
ans = max(a,b)
for i in range(N):
    if s[i] == 'R':
        a = a - 1
    else:
        b = b + 1
    now = max(a,b)
    ans = min(ans, now)
print(ans) N = int(input()) N int(input()) int input() input s = str(input()) s str(input()) str input() input a = 0 a 0 b = 0 b 0 for i in range(N):
    if s[i] == 'R':
        a = a + 1 i range(N) range N if s[i] == 'R':
        a = a + 1 s[i] == 'R' s[i] s i 'R' a = a + 1 a a + 1 a 1 ans = max(a,b) ans max(a,b) max a b for i in range(N):
    if s[i] == 'R':
        a = a - 1
    else:
        b = b + 1
    now = max(a,b)
    ans = min(ans, now) i range(N) range N if s[i] == 'R':
        a = a - 1
    else:
        b = b + 1
     s[i] == 'R' s[i] s i 'R' a = a - 1 a a - 1 a 1 b = b + 1 b b + 1 b 1 now = max(a,b) now max(a,b) max a b ans = min(ans, now) ans min(ans, now) min ans now print(ans) print ans a = 0 0 a ans = max(a,b) max(a,b) ans now = max(a,b) max(a,b) now b = 0 0 b b = b + 1 b + 1 b ans = min(ans, now) min(ans, now) ans N = int(input()) int(input()) N s = str(input()) str(input()) s a = a - 1 a - 1 a a = a + 1 a + 1 a
N = int(input())
s = str(input())

a = 0
b = 0

for i in range(N):
    if s[i] == 'R':
        a = a + 1
ans = max(a,b)
for i in range(N):
    if s[i] == 'R':
        a = a - 1
    else:
        b = b + 1
    now = max(a,b)
    ans = min(ans, now)
print(ans)
