import scala.math.{min,max}

object Main {
  val sc = new java.util.Scanner(System.in)
  def main(args: Array[String]) {
    val l, a, b, c, d = sc.nextInt
    println(l - max((a+c-1)/c, (b+d-1)/d))
  }
}