N = int(input())
S = input()
k = 0
s = 0
ans0 = 0
ans1 = 0

for i in range(N):
    if S[i] == "#":
        k = i
        break

for i in range(k+1,N):
    if S[i] == ".":
        ans0 += 1

for i in range(N-1,0,-1):
    if S[i] == ".":
        s = i
        break

for i in range(s-1,-1,-1):
    if S[i] == "#":
        ans1 += 1

print(min(ans0,ans1))