n=int(input())
S=[0 if i=='.' else 1 for i in input()]
if sum(S)==0 or sum(S)==n:
    print(0)
    exit()
Skai=[]
tmp=0
for i in range(n):
    if S[i]==1:
        if tmp==0:
            Skai.append(0)
        tmp+=1
    if S[i]==0:
        if tmp!=0:
            Skai.append(tmp)
        tmp=0
        if i==n-1:
            Skai.append(0)
ans2=sum(Skai)-Skai[-1]

start=0
for i in range(n):
    if S[i]==1:
        start=i
        break

newS=S[start:]
ans=0
for s in newS:
    if s==0:
        ans+=1
print(min(ans,ans2))