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 = min(s.count('.'), s.count('#'))
    print(ans)