n = int(input()) 
s = input()  
po = [0] * (n + 1)
s = '#' + s
for i in range(1, n + 1):
    po[i] = int(s[i] == 'R')
cur = 0
for i in range(1, n + 1):
    if cur % 2 == 0:
        if po[i]:
            cur += 1
        cur += 1
    else:
        if not po[i]:
            cur += 1
        cur += 1
 
print(cur)

