object Main extends App {
  import scala.io.StdIn._


  val l = readLine.trim.toInt
  val a = readLine.trim.toInt
  val b = readLine.trim.toInt
  val c = readLine.trim.toInt
  val d = readLine.trim.toInt
  println(
    l - List((a + c - 1) / c, (b + d - 1) / d).max
  )
  implicit class ScopeFunc[T](val value: T){
    def let[A](func: T ⇒ A): A = func(value)
    def also(func: T ⇒ Unit): T = {
      func(value)
      value
    }
  }
}
