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
    change_black = get_cost_change_black(S[indexs[0]:])
    for i, ind in enumerate(indexs):
        x = change_white + change_black
        if x < answer:
            answer = x
        if i == len(indexs) - 1:
            break
        change_black = change_black + (indexs[i+1] - indexs[i] - 1)
        change_white = change_white + 1
    print(answer)
