N = int(input())
S = input()
#print(S)
ans = 0
hens = 0
for j in range(N):
    if S[j] == "#":
        for i in range(N - j -1):
            if S[i] == ".":
                ans += 1
        break

for k in range(N):
    if S[-k-1] == ".":
        for u in range(N - k -1):
            if S[-u-1] == "#":
                hens += 1
        break

print(min(ans, hens))