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

flg = False
cnt_w = 0
for s in S:
    if not flg:
        if s=='#':
            flg = True
    else:
        if s=='.':
            cnt_w += 1

flg = False
cnt_b = 0
for s in S[::-1]:
    if not flg:
        if s=='.':
            flg = True
    else:
        if s=='#':
            cnt_b += 1
print(min(cnt_w, cnt_b))