from itertools import accumulate

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

black=[0]*N
white=[0]*N

for i,s in enumerate(S):
    if s=='#':
        black[i]=1
    else:
        white[i]=1

black=[0]+black
black=list(accumulate(black))
white=[0]+white[::-1]
white=list(accumulate(white))[::-1]

ans=[]

for i in range(N+1):
    ans.append(black[i]+white[i])

print(min(ans))