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

def count_diff(str1, str2):
  return sum([1 if j != str2[i] else 0 for i, j in enumerate(str1)])

if '.' not in s or '#' not in s:
  print(0)
elif '#.' not in s:
  print(0)
else:
  if s[n-1] == '#':
    s = s[:s.rfind('.')+1]
  if '.' == s[0]:
    s = s[s.find('#'):]
  len_s = len(s)
  print(min([count_diff(s, te) for te in ['.' * i + '#' * (len_s - i) for i in range(0, len_s+1)]]))
  
  #print(min(s.count('.'), s.count('#')))
