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

a = s[0:s.rfind('.')].count('#')
b = s[s.find('#'):n].count('.')
c = 0

for i in range(n//2):
  if s[i] == "#" and s[i:n].find('.') != -1:
    c += 1
  if s[n-i] == "." and s[i:n].find('#') != -1:
    c += 1
    
ans = min([a, b, c])
print(ans)
