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

for k in range(N-1):
    if T[-k-1] == "." and T[-k-2] == "#":
        hens += 1
        T = T.replace("#",".",-k-2)
print(min(ans, hens))