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

def inverse(b, w, index, first):
    count = b[index//2 + 1] + w[-1] - w[(index + 1)//2]
    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)

b = [0]
w = [0]
offset = 0
bsum = 0
wsum = 0
if first == '*':
    offset = 1
for i in range(len(num)):
    if i % 2 == offset:
        bsum += num[i]
        b.append(bsum)

offset = abs(offset -1)
for i in range(len(num)):
    if i % 2 == offset:
        wsum += num[i]
        w.append(wsum)

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