n=int(input())
s=input()

i=0
for ss in s:
  if ss=="#":
    break
  i+=1

s=s[i:]  
  
cnt=0
for i in range(1,n+1):  
  if s[-1*i]=="#":
    cnt+=1
  else:
    break

s=s[:-1*cnt]
#print(s)
  
print(min(s.count("."),s.count("#")))

  