n = int (input ())
s = input ()
x = 0
y = 0
for i in range (n):
  if s[i] == '#':
    x = 1
  else:
    if x == 1:
      y += 1
x = 0
z = 0
for i in range (n):
  if s[n-1-i] == '.':
    x = 1
  else:
    if x == 1:
      z += 1
if y < z:
  print (y)
else:
  print (z)