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

ans = 10**9

T = "#."
W = '.'
B = '#'

for _ in range(2):
    cnt = 0
    SS = S.copy()
    if _ & 1:
        for ix in range(0, N-1):
            if SS[ix] == B and SS[ix+1] == W:
                SS[ix+1] = B
                cnt += 1
    else:
        for ix in range(N-1, 0, -1):
            if SS[ix] == W and SS[ix-1] == B:
                SS[ix-1] = W
                cnt += 1

    if cnt < ans:
        ans = cnt

print(ans)