n=int(input())
s=input()+'?'
white=s.count('.')
black=s.count('#')
ans1=n-black
ans2=n-white
ans3=10**10
if '.' in s:
  index=s.index('.')
  for i in range(index,n+1):
    if s[i]=='.':
      continue
    else:
      index=i
      break
  ans3=s[:index].count('#')+s[index:].count('.')
print(min(ans1,ans2,ans3))