import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    long N = scan.nextLong();
    long A = scan.nextLong();
    long B = scan.nextLong();
    scan.close();

    long count = N / (A + B);
    long amari = N % (A + B);

    System.out.println(A * count + (A>=amari ? amari : A));
  }
} import java.util.Scanner; Scanner java.util public class Main {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    long N = scan.nextLong();
    long A = scan.nextLong();
    long B = scan.nextLong();
    scan.close();

    long count = N / (A + B);
    long amari = N % (A + B);

    System.out.println(A * count + (A>=amari ? amari : A));
  }
} Main public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    long N = scan.nextLong();
    long A = scan.nextLong();
    long B = scan.nextLong();
    scan.close();

    long count = N / (A + B);
    long amari = N % (A + B);

    System.out.println(A * count + (A>=amari ? amari : A));
  } main {
    Scanner scan = new Scanner(System.in);
    long N = scan.nextLong();
    long A = scan.nextLong();
    long B = scan.nextLong();
    scan.close();

    long count = N / (A + B);
    long amari = N % (A + B);

    System.out.println(A * count + (A>=amari ? amari : A));
  } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) long N = scan.nextLong(); N scan.nextLong() scan.nextLong scan long A = scan.nextLong(); A scan.nextLong() scan.nextLong scan long B = scan.nextLong(); B scan.nextLong() scan.nextLong scan scan.close() scan.close scan long count = N / (A + B); count N / (A + B) N (A + B) A B long amari = N % (A + B); amari N % (A + B) N (A + B) A B System.out.println(A * count + (A>=amari ? amari : A)) System.out.println System.out System System.out A * count + (A>=amari ? amari : A) A * count A count (A>=amari ? amari : A) A>=amari A amari amari A String[] args args public class Main {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    long N = scan.nextLong();
    long A = scan.nextLong();
    long B = scan.nextLong();
    scan.close();

    long count = N / (A + B);
    long amari = N % (A + B);

    System.out.println(A * count + (A>=amari ? amari : A));
  }
} public class Main {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    long N = scan.nextLong();
    long A = scan.nextLong();
    long B = scan.nextLong();
    scan.close();

    long count = N / (A + B);
    long amari = N % (A + B);

    System.out.println(A * count + (A>=amari ? amari : A));
  }
} Main
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    long N = scan.nextLong();
    long A = scan.nextLong();
    long B = scan.nextLong();
    scan.close();

    long count = N / (A + B);
    long amari = N % (A + B);

    System.out.println(A * count + (A>=amari ? amari : A));
  }
}