N = int(input())
S = input()

ans =  S.count(".")
l = [0, ans]
for i in range(N):
    if S[i] == "#":
        l[0] += 1
    else:
         l[1] -= 1
    
    if ans > sum(l):
        ans = sum(l)
print(ans)