N = int(input())
S = list(input())
s = 0
l = N - 1
while s < N and S[s] == ".":
    s += 1
while l >= 0 and S[l] == "#":
    l -= 1
if s >= l:
    print(0)
    exit()
ans = min(S[s:l+1].count("."), S[s:l+1].count("#"))
print(ans)
