n=int(input())
s=list(input())
ans=0
ans2=0
now="."
now2="."
for i in s:
  if ans2<ans:
    now=now2
    ans=ans2
  if now=="#" and i==".":
    ans+=1
  else:
    now=i
  if now2=="#" and i==".":
    ans2+=1
    now2="."
  else:
    now2=i
print(ans)