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

count=0
stone=[]
x=len(S)-1
for i in range(0,x):
    if(S[i]=="#" and S[i+1]=="." ):
        count=count+1
        S=S.replace(S[i],"#")

stone.append(count)
print(min(stone))
