N = int(input())
S = input()
ans = 1000000
z = 0
for i in range(N):
  tmp = S[:i]
  tmp2 = S[i:]
  A = tmp.count('#')+tmp2.count('.')
  B = tmp.count('#')+tmp2.count('#')
  C = tmp.count('.')+tmp2.count('.')
  if A <= B and A <= C:
    z = A
  elif B <= A and B <= C:
    z = B
  else:
    z = C
    
  if z<ans:
    ans = z
print(ans)