N = int(input())
S = list(input())

cnt1 = 0
S1 = S.copy()
for i in range(N-1):
    if (S1[i] == "#" and S1[i+1] == "."):
        cnt1 += 1
        S1[i+1] = "#"

S2 = S.copy()
cnt2 = 0
for i in range(N-1):
    if (S2[i] == "#" and S2[i+1] == "."):
        cnt2 += 1
        S2[i] = "."
        
        

print(min(cnt1, cnt2))
