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

B = 0
W = 0

for i in range(0,N-1):
    if S[i] == '#':
        if i+1 > N:
            pass
        elif S[i+1] == '.':
            B = B+1
    else:
        W = W+1
if W >= B:
    print(B)
else:
    print(W)