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
ans=[]
for i in range(N+1):
        ans.append(black[i]+white[i])
print(min(ans))