n = gets.to_i
s = gets.to_s.chomp
def solve(n, s)
  black_index = s.index('#')
  return 0 if black_index == nil
  #   puts "b_i = #{black_index}"
  #   puts "#{s[black_index + 1..-1]}"
  if s[black_index + 1..-1].scan('.') == nil
    return 0
  else
    i_white = s[black_index + 1..-1].scan('.').length
  end
  black2 = n

  t = s[black_index..-1].split('.').map { |value| value unless value == '' }
  t = t.compact
  black2 = s[black_index..-1].index('.') if t.length == 2
  i_black = n - black_index - i_white
  return [i_white, i_black, black2].min
end
ans = solve(n, s)
puts ans
