N = gets.to_i
s = gets.chomp.split("")
f,e = -1
i = 0
while s.size > i
  if f == -1 && s[i] == "."
    f = i
  end
  if s[i] == "."
    e = i
  end
  i+=1
end
zenhanarray = s[0..f-1]
kouhanarray = s[f+1..s.size]
firstresult = zenhanarray.count(".")+kouhanarray.count("#")
zenhanarray = s[0..e-1]
kouhanarray = s[e+1..s.size]
endresult = zenhanarray.count(".")+kouhanarray.count("#")
puts [firstresult,endresult].sort[0]
