N=int(input())
S=input()
ans=0
black=0
white=0
bla=0
whi=0
for n in range(N-1):
    if S[n]=='.':
        white+=1
        whi+=1
    else:
        black+=1
        bla+=1
    if S[n]=='.' and S[n+1]=='#':
        ans+=min(white,black)
        white=0
        black=0
if S[-1]=='.':
    white+=1
else:
    black+=1
if S[-1]=='.':
    ans+=min(white,black)
print(min(ans,whi,bla))
