N=int(input())
S=str(input())
A=[]
B=[]
for i in S:
    A.append(i)
for i in S:
    B.append(i)
count1=0
count2=0
for i in range(N-1):
    if (A[i]=="#")and( A[i+1]=="."):
        A[i+1]="#"
        count1+=1


if B[-1]=="#":
  for i in range(N-1,0,-1):
      if B[i]=="#"and B[i-1]==".":
        B=B[:i]
for i  in range(len(B)):
    if B[ i]  =="#":
        B[i]="."
        count2+=1

ans=min(count1,count2)
print(ans)