n = int(input())
s = input()

def next(s):
  if s == '':  # empty
    return 0, 0, None
  if len(s) == s.count('#') or len(s) == s.count('.'):  # . or # only
    return s.count('#'), s.count('.'), None

  l = s.index('#')
  try:
    c = s.index('#.')+1
    try:
      r = s.index('.#')+1
    except:
      r = len(s)-1
  except:
    c,r = len(s)-1
  b = c - l
  w = r - c
  return b, w, s[r:]

black, white = 0, 0
if n == s.count('#') or n == s.count('.'):  # . or # only
  black += s.count('#')
  white += s.count('.')
  s = None
else:
  if s[0] == '.':
    s = s[s.index('.#')+1:]
while(s != None):
  b, w, s = next(s)
  black += b
  white += w
print(min(black, white))