n=int(input())
s=input()

w_num=0
b_num=0
w_l=[]
b_l=[]

for i in s:
 if i=='.':
  w_num+=1
 else:
  b_num+=1
 w_l.append(w_num)
 b_l.append(b_num)

ans=10**5
for i in range(n):
 ans=min(ans,b_l[i]+(w_num-w_l[i]))
print(ans)