s = gets.to_i
n = gets.chomp.split("")
bw = Array.new(4,0)
ans = 0
for i in 1..s
  if bw[0] == 0 && n[-i] == "#"
    bw[1] += 1
  elsif bw[0] == 0 && n[-i] == "."
    bw[3] += 1
    bw[0] = 1
  elsif bw[0] == 1 && n[-i] == "#"
    bw[2] += 1
  else
    bw[3] += 1
  end
end
puts [bw[2],bw[3]].min
