n = gets.chomp
s = gets.chomp.split(//)

ans = 10000000

a = 0
b = 0

s.size.times do |i|
  count = 0
  left = s[0..i]
  right = s[(i+1)..-1]
  left.each do |c|
    count += 1 if c == '#'
  end
  right.each do |c|
    count += 1 if c == '.'
  end

  ans = [ans, count].min
end

puts ans
