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

ans1 = 1e7
ans2 = 1e7
f = False
for i in range(N-1):
    if S[i:i+2] == "#.":
        ans1 = S[i:].count(".")
        f = True
        break

for i in range(N-1):
    j = N - i
    if S[j-2:j] == "#.":
        ans2= S[:j-1].count("#")
        f = True
        break

print(min(ans1, ans2) if f else 0)