n = int(input())
S = input()

w,b = 0,0
ws,bs = [],[]
for s in S:
    if s != '.':
        break
    ws.append('.')

for s in S[::-1]:
    if s != '#':
        break
    bs.append('#')

S.lstrip(''.join(ws))
S.rstrip(''.join(bs))

for s in S:
    if s == '.':
        w += 1
    else:
        b += 1

if b > w:
    print(w)
else:
    print(b)
