N=int(input())
S=list(input())
li=[]
count=0
for i in range(N):
    if S[i]==".":
        count+=1
    elif S[i]=="#":
        li.append(count)
        count=0
li.append(count)
del li[0]
print(min(sum(li),S.count("#")))