input()

S = input()
flag  = False

ans1 = 0
for c in S:
    if c == '#':
        flag = True
    if not(flag):
        continue
    if c == '.':
        ans1 += 1
ans2 = 0
for c in reversed(S):
 if c == '.':
        flag = True
    if not(flag):
        continue
    if c == '#':
        ans2 += 1


print(min(ans1,ans2))
