import math
N = int(input())
S = input()
col = "#."
hoge = 0
C = [0]
for i in range(N):
    if S[i] == col[hoge]:
        C[-1] += 1
    else:
        C.append(1)
        hoge = (hoge+1)%2
B,W =0,0
for i in range(math.floor(len(C)/2)):
    B += C[i*2]
    W += C[i*2+1]
if C[0] == 0:
    W -= C[1]
print(min(B,W))