n = int(input())
s = '.'+input()
ans = []

def div(i, s):
  l = s[:i.start()+1]
  r = s[i.end()-1:]
  lb = l.count('#')
  rw = r.count('.')
  return l, lb, r, rw
  
for i in re.finditer(r'#\.', s):
  l, lb, r, rw = div(i, s)
  ans.append(lb+rw)
for i in re.finditer(r'\.#', s):
  l, lb, r, rw = div(i, s)
  ans.append(lb+rw)
if len(ans) > 0:
  print(min(ans))
else:
  print(0)