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

W=[1 if S[0]=="." else 0]
ans=float("inf")

for i in range(1,N):
  if S[i]==".":
    W.append(W[-1]+1)
  else:
    W.append(W[-1])

for i in range(N):
  cost_W = i+1-W[i]
  cost_B = W[-1]-W[i]
  cost=cost_W+cost_B
  #print(N, W[-1], i+1, W[i])
  #print("cost_W:",cost_W,"cost_B:",cost_B,cost)
  ans=min(ans,cost)
  
print(ans)