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

WtoBcounter = 0
for i in range(N):
    if S[i] == "#":
        for j in range(i+1, N):
            if S[j] == ".":
                WtoBcounter += 1
        break

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

output = 0
if WtoBcounter < BtoWcounter:
    output = WtoBcounter
else:
    output = BtoWcounter

print(output)