N = int(input())
S = str(input())
if S.count('.') > S.count('#'):
    ans = S.count('#')
    ch = '#'
else:
    ans = S.count('.')
    ch = '.'
if S[0] == '.' and ch == '.':
    ans -= 1
elif S[-1] == '#' and ch == '#':
    ans -= 1
print(ans)
    