n = gets.to_i
s = gets.to_s.chomp
def solve(n, s)
  s.scan('.') == nil ? white = 0 : white = s.scan('.').length
  black = n - white
  x = s.scan('#.').length

  if s.index('#') == nil
    return 0
  else
    black_index = s.index('#')
  end

  if s[black_index + 1..-1].scan('.') == nil
    i_white = 0
  else
    i_white = s.scan('.').length
  end
  i_black = n - black_index - 1 - i_white

  return [white, black, i_white, i_black].min
end
ans = solve(n, s)
puts ans
