object Main extends App {
  val Array(n,a,b) = io.StdIn.readLine().split(' ').map(_.toLong)
  var current: Long = 0
  var count: Long = 0
  while (current < n) {
    current += a
    if (current < n) {count += a}
    else {count += (current - n - 1)}
    current += b
  }
  println(count)
}