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

def countHand(st, pos):
  left_b = st[:pos].count('#')
  right_w = st[pos:].count('.')
  count = left_b + right_w
  return count
  
minHand = 2 * 10 **5
for i in range(len(S)+1):
  ret = countHand(S, i) 
  if ret <= minHand:
    minHand = ret

ans = minHand
print("{}".format(ans))