def get_cost_change_black(S):
    return S.count(".")

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

indexs = [i for i, x in enumerate(S) if x == "#"]
if len(indexs) == 0:
    print(0)
else:
    answer = 10000000
    change_white = 0
    for i in indexs:
        x = change_white + get_cost_change_black(S[i:])
        if x < answer:
            answer = x
        change_white = change_white + 1
        if change_white >= x:
            break
    print(answer)
