n = int(input())
s = input()
ans = 0
if s.count('.') != 0:
  white = s.index('.')
  if s.index('.') > 1:
    ans += s.index('.')
  black_num = s.count('#')
  white_num = s.count('.')
print(min(black_num, white_num)+ans)