N = gets.to_i
S = gets.chomp

bc = 0
wc = 0

bc_list = []
wc_list = []

S.each_char do |s|
  if s == '#'
    bc += 1
  else
    wc += 1
  end

  bc_list << bc
  wc_list << wc
end

ans = Float::INFINITY

(N + 1).times do |i|
  lwrb = if i == 0
           bc
         elsif i == N
           wc
         else
           bc_list[i - 1] + wc - wc_list[i - 1]
         end

  ans = lwrb if ans > lwrb
end

puts ans
