N=int(input())
S=str(input())

if S.count('#')==N or S.count('.')==N:
    print(0)
elif S[0]=='#':
    print(min(S.count('#'),S.count('.')))
else:
    renzoku=1
    for i in range(1,N):
        if S[i]=='.':
            renzoku+=1
        else:
            break
    S=S[renzoku:]
    print(min(S.count('#'),S.count('.')))