n=int(input())
s=list(input())
count=0
if s[0]=="#":
  for i in range(1,n):
    if s[i]==".":
      count=count+1
else:
  count1=0
  count2=0
  for i in range(n):
    if s[i]=="#":
      count1=count1+1
    else:
      count2=count2+1
  count=min(count1,count2)
print(count)