import java.io.{BufferedOutputStream, BufferedReader, InputStreamReader, PrintWriter}

object Main {
  def main(args: Array[String]): Unit = {
    val in = new BufferedReader(new InputStreamReader(System.in))
    val out = new PrintWriter(new BufferedOutputStream(System.out))
    val Array(n, a, b) = in.readLine().split("\\s+").map(_.toLong)

    out.println(
      n / (a + b) * a + Math.min(a, n % (a + b))
    )
    out.flush()
  }
}
