n=int(input())
s=input()
sirocnt=s.count('.')
kurocnt=0
ans=[sirocnt]
for i in range(n):
    if s[i]=='.':
        sirocnt-=1
    else:
        kurocnt+=1
    ans.append(sirocnt+kurocnt)
print(min(ans))