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

cnt_w = 0
flg = 0
for i in range(N-1):
    if flg and S[i+1] == '.':
        cnt_w += 1
    elif S[i] == '#' and S[i+1] == '.':
        flg = 1
        cnt_w += 1
    else:
        flg = 0

cnt_b = 0
flg = 0
for i in range(N-1, 0, -1):
    if flg and S[i-1] == '#':
        cnt_b += 1
    elif S[i-1] == '#' and S[i] == '.':
        flg = 1
        cnt_b += 1
    else:
        flg = 0

print(min(cnt_w, cnt_b))
