d = read_line.to_i a, b = read_line.split.map(&.to_i) x = (d / (a + b) * b).to_i puts x * a + (d - x) * b