a = int(input())
b = input()

change = 0
br = 0
wh = 0
for i in range(a):
  if(b[i] == '#'):
    change = 1
  if change == 1:
    if(b[i] == '#'):
      br += 1
    else:
      wh += 1
if(br >= wh):
  print(wh)
else:
  print(br)
