n = int(input())
s = input()
cnt = 0

if s.count('#') < s.count('.'):
    cnt += s.count('#')
else:
    cnt += s.count('.')
    if s.startswith('.'):
        cnt -= 1

if '#' not in s:
    cnt = 0
elif '.' not in s:
    cnt = 0

print(cnt)