n = int(input())
s = input()
 
if s.count('.') == len(s):
    print(0)
elif s.count('#') == len(s):
    print(0)
else:
    s_ = s
    for i, wb in enumerate(s_):
        if wb == '.':
            s_ = s[i+1:]
        else:
            break
    
    ans_black_change = s_.count('#')
    if s[-1] == '#':
        ans_black_change -= 1
    ans_white_change = s_.count('.')
    
    ans = min(ans_black_change, ans_white_change)
    print(ans)