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

flg = False
ans = 0

for i in s:
    if i == '#':
        flg = True

    if flg is True and i == '.':
        ans += 1

flg2 = False
ans2 = 0

ss = list(s)[::-1]

for i in ss:
    if i == '.':
        flg2 = True

    if flg2 is True and i == '#':
        ans2 += 1

print(min(ans, ans2))