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

ans=10**9+7
lb=0
rb=S.count('#')
rw=S.count('.')

if rb==0 or rw ==0:
    ans=0

for i in range(N):
    if S[i] == '.':
        rw -= 1
    else:
        ans = min(ans, lb + rw)
        lb+=1

print(ans)