n=int(input())
s=input()
c=0
b=0
p=0
for i in range(n):
  if s[i]=="."and s[i-1]=="#":
    c+=b
    b=0
  elif s[i]=="#":
    b+=1
  else:
    b=0
for i in range(n):
  if s[i]==".":
    p+=1
  else:
    break

if c>(n/2):
  print(n-c-p)
else:
  print(c)