N=int(input())
S=input().split()
ans_1=0
ans_2=0

for i in range(0,N-1):
    for m in range(0,i)
        if S[m]=".":
            ans_1+=1
        else:
            ans_2+=1
    for k in range(i,N-1):
        if S[k]="#":
            ans_1+=1
        else:
            ans_2+=1

print(min(ans_1,ans_2))
