### main

loop do
  n, a, b = gets.split.map(&:to_i)
  break if (n | a | b) == 0
  #p [n, a, b]

  tfs = (n + 1).times.map{false}
  tfs[0] = true

  count = 0

  for i in (1..n)
    if (i >= a && tfs[i - a]) || (i >= b && tfs[i - b])
      tfs[i] = true
    else
      count += 1
    end
  end

  p count
end