#coding: utf-8
N = int(input())
S = list(input())
S1, S2 = S[:], S[:]
S2.reverse()
c1, c2 = 0, 0
for i in range(N-1):
    if S1[i] == "#" and S1[i+1] == ".":
        c1 += 1
        S1[i+1] = "#"
for j in range(N-1):
    if S2[j] == "." and S2[j+1] == "#":
        c2 += 1
        S2[j+1] = "."
print(min(c1, c2))