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