n = int(input())
s = input()

if s.count('.') == len(s):
    print(0)
else:
    for i, wb in enumerate(s):
        if wb == '#':
            break
        else:
            s = s[i+1:]
    
    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)