N= int(input())
moji = list(input())

counter1=0
counter2=0
flag1=0
flag2=0
for i in range(N):

    if flag1 ==0:
        if moji[i]=="#":
            flag1=1
    elif flag1==1:
        if moji[i]==".":
            counter1+=1

    if flag2==0:
        if moji[N-i-1]==".":
            flag2=1
    elif flag2==1:
        if moji[N-i-1]=="#":
            counter2+=1

print(min(counter1,counter2))
