import re

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

after_b_s = re.sub('^\.*(#.+)', r'\1', s)
w2b_cnt = 0 if '#' not in after_b_s else after_b_s.count('.')
b2w_cnt = 0 if '.' not in after_b_s else after_b_s.count('#')

print(min(w2b_cnt, b2w_cnt))
