n=int(input())
s=input()
m=min(s.count('.'),s.count('#'))
if s[0]=='.' and s[n-1]=='#':
  m=m-1
elif s[0]=='.' and s.count('.')<=s.count('#'):
  m=m-1
elif s[n-1]=='#' and s.count('.')=>s.count('#'):
  m=m-1
else:
  m=m
print(m)

