n = int(input())
s = input()
try:
  leftb = s.index('#')
except:
  leftb = -1

if leftb >= 0:
  w = s[leftb:].count('.')
  b = s[leftb:].count('#')
  if s[-1] == '#':
    b -= 1
  ans = min(w,b)
else:
  ans = 0
print(ans)