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