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


cnt = [0,0]
flg = False
for s in S:
    if not flg:
        if s == "#":
            flg = True
        else:   
            continue

    if s == ".":
        cnt[0] += 1
    else:
        cnt[1] += 1

print(min(cnt))