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