import java.util.Scanner;

class Main {

  public static void main(String[] args) {
    new Main().run();
  }

  private Scanner sc = new Scanner(System.in);

  private void run() {
    long N = sc.nextLong();
    long A = sc.nextLong();
    long B = sc.nextLong();

    long aSet = N / (A + B) * A;
    long mod = N % (A + B);

    System.out.println(aSet + Math.min(mod, A));
  }
} import java.util.Scanner; Scanner java.util class Main {

  public static void main(String[] args) {
    new Main().run();
  }

  private Scanner sc = new Scanner(System.in);

  private void run() {
    long N = sc.nextLong();
    long A = sc.nextLong();
    long B = sc.nextLong();

    long aSet = N / (A + B) * A;
    long mod = N % (A + B);

    System.out.println(aSet + Math.min(mod, A));
  }
} Main private Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) {
    new Main().run();
  } main {
    new Main().run();
  } new Main().run() new Main().run new Main() String[] args args private void run() {
    long N = sc.nextLong();
    long A = sc.nextLong();
    long B = sc.nextLong();

    long aSet = N / (A + B) * A;
    long mod = N % (A + B);

    System.out.println(aSet + Math.min(mod, A));
  } run {
    long N = sc.nextLong();
    long A = sc.nextLong();
    long B = sc.nextLong();

    long aSet = N / (A + B) * A;
    long mod = N % (A + B);

    System.out.println(aSet + Math.min(mod, A));
  } long N = sc.nextLong(); N sc.nextLong() sc.nextLong sc long A = sc.nextLong(); A sc.nextLong() sc.nextLong sc long B = sc.nextLong(); B sc.nextLong() sc.nextLong sc long aSet = N / (A + B) * A; aSet N / (A + B) * A N / (A + B) N (A + B) A B A long mod = N % (A + B); mod N % (A + B) N (A + B) A B System.out.println(aSet + Math.min(mod, A)) System.out.println System.out System System.out aSet + Math.min(mod, A) aSet Math.min(mod, A) Math.min Math mod A
import java.util.Scanner;

class Main {

  public static void main(String[] args) {
    new Main().run();
  }

  private Scanner sc = new Scanner(System.in);

  private void run() {
    long N = sc.nextLong();
    long A = sc.nextLong();
    long B = sc.nextLong();

    long aSet = N / (A + B) * A;
    long mod = N % (A + B);

    System.out.println(aSet + Math.min(mod, A));
  }
}
