n = int(input())
s = input()
min = s.count('#')
if s.count('.')  < min:
  min = s.count('.') 
for i in range(len(s)-1):
  if s[:i].count('#') + s[i+1:].count('.')  < min:
    min = s[:i].count('#') + s[i+1:].count('.')
print(min)