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

ans1 = 1e7
ans2 = 1e7
ans3 = 1e7
f = False
for i in range(N-1):
    if S[i:i+2] == "#.":
        ans1 = S[i+1:].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
        
for k in range(j-1):
    if S[j-2-k] == ".":
        ans3 = S[:j-1-k].count("#") + S[j-1:].count(".")
        break
    
print(min(ans1, ans2, ans3) if f else 0)