N=int(input())
S=input()

X=[]*N
anser=0
k=0
if S[0]==".":
    for i in S:
        if i=="#" and k==0:
            k+=1
        if i=="." and k!=0:
            anser+=1

K=0
if S[0]=="#":

    for i in S:

        if i=="." and K==1:
            anser+=1
        else:
            K=1

print(anser)
