N=int(input())
S=input()
leftid=-1
rightid=-1
blcnt=0
whcnt=0
#黒に変更
for i in range(N):
    if S[i]=="#":
        leftid=i
        break
for i in range(N):
    if S[N-1-i]==".":
        rightid=N-i-1
        break
if leftid!=-1:
    for i in range(leftid,N,1):
        if S[i]==".":
            blcnt=blcnt+1
else:
    blcnt=0
if rightid!=-1:
    for i in range(rightid,-1,-1):
        if S[i]=="#":
            whcnt=whcnt+1
else:
    whcnt=0
print(min(blcnt,whcnt))

