N = gets.to_i
S = gets.chomp

bi = S.index('#')
wir = S.reverse.index('.')

bmin = N
if bi
  bn = S[bi,N-bi].count('#')
  wn = S[bi,N-bi].count('.')
  if wn.nil?
    puts 0
  else
    bmin = [bn,wn].min
  end
else
  puts 0
end
wmin = N
if wir
  wn = S.reverse[wir,N-wir].count('#')
  if wn.nil?
    puts 0
  else
    wmin = wn
  end
end

puts [bmin,wmin].min