n = int(input())
s = input()

def inverse(num, index, first):
    offset = 0
    if first == '*':
        offset = 1
    count = 0
    for n, i in enumerate(num):
        if n <= index and n % 2 == offset:
            count += i
        elif n > index and n % 2 != offset:
            count += i
    return count

num = []
first = s[0]
end = s[-1]
pre = first
count = 0
for c in s:
    if c == pre:
        count += 1
    else:
        num.append(count)
        count = 1
        pre = c
num.append(count)

print(num)

if len(num) == 1:
    print(0)
else:
    minlist = []
    for i in range(len(num)):
        minlist.append(inverse(num, i, first))
    print(min(minlist))

