import re
N = int(input())
S = input()
ans=2*10**5

l = []
for i in range(len(S)):
    if S[i] == "#":
        l.append(i)


if S.count("#") == 0 or S.count(".") == 0:
    print(0)

else:
    for i in l:
        a = S[i+1:].count(".")+S[:i].count("#")
        ans = min(a,ans)
    print(ans)
    