N = int(input())
S = input()
min = N
if S.find('#') == -1 or S.find('.') == -1:
    min = 0
else:
    for i in range(S.find('#'),S.rfind('#')+1):
        if S[i] == '.' and S[i+1] == '#':
            left = S.count('#',0,i)
            right = S.count('.',i+1)
        elif S[i] == '#' and S[i+1] =='.':
            left = S.count('#',0,i)
            right = S.count('.',i)
        if left + right < min:
            min = left + right
print(min)