def get_min_cost(S):
    if len(S) == 0:
        return 0
    if len(S) == 1:
        return 0
    return min(1 + get_min_cost(S[1:]), get_cost_change_black(S))

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

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

if '#' in S:
    answer = get_min_cost(S[S.index('#'):])
    print(answer)
else:
    print(0)
