N=int(input())
ls_S=list(input())
i=0
I=0
cnt_1=0
cnt_2=0

while ls_S[i]=="#":
    i+=1
    I+=1

for x in range(I,N):
    if ls_S[x]==".":
        ls_S[x]="#"
        cnt_1+=1
    else:
        ls_S[x]="."
        cnt_2+=1
if cnt_1>cnt_2:
    print(cnt_2)
else:
    print(cnt_1)
        



