# c
import copy

N = int(input())
S = list(input())
S = S[::-1]
Ss = copy.deepcopy(S)
ans0 = 0
ans1 = 0

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

for i in range(1, N):
    if Ss[i-1] == "." and Ss[i] == "#":
        ans1 += 1
        Ss[i-1] = "#"

print(min(ans0, ans1))