N=int(input())
S=input()
countB=N
countW=0
i=0
while i<N:
    if S[i]=='.':
        countW+=1
    else:
        break
    i+=1

i=N-1
while i>=0:
    if S[i]=='#':
        countB-=1
    else:
        break
    i-=1

S=S[countW:countB]
print(min(S.count('.'),S.count('#')))