import java.util.*;
import java.math.*;

public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long n = sc.nextLong();
    long a = sc.nextLong();
    long b = sc.nextLong();

    long sum = a+b;

    long w = n/sum;
    long p = n%sum;


    System.out.println(w*a+Math.min(p,a));


  }
} import java.util.*; util.* java import java.math.*; math.* java public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long n = sc.nextLong();
    long a = sc.nextLong();
    long b = sc.nextLong();

    long sum = a+b;

    long w = n/sum;
    long p = n%sum;


    System.out.println(w*a+Math.min(p,a));


  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long n = sc.nextLong();
    long a = sc.nextLong();
    long b = sc.nextLong();

    long sum = a+b;

    long w = n/sum;
    long p = n%sum;


    System.out.println(w*a+Math.min(p,a));


  } main {
    Scanner sc = new Scanner(System.in);
    long n = sc.nextLong();
    long a = sc.nextLong();
    long b = sc.nextLong();

    long sum = a+b;

    long w = n/sum;
    long p = n%sum;


    System.out.println(w*a+Math.min(p,a));


  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) 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 sum = a+b; sum a+b a b long w = n/sum; w n/sum n sum long p = n%sum; p n%sum n sum System.out.println(w*a+Math.min(p,a)) System.out.println System.out System System.out w*a+Math.min(p,a) w*a w a Math.min(p,a) Math.min Math p a String[] args args public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long n = sc.nextLong();
    long a = sc.nextLong();
    long b = sc.nextLong();

    long sum = a+b;

    long w = n/sum;
    long p = n%sum;


    System.out.println(w*a+Math.min(p,a));


  }
} public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long n = sc.nextLong();
    long a = sc.nextLong();
    long b = sc.nextLong();

    long sum = a+b;

    long w = n/sum;
    long p = n%sum;


    System.out.println(w*a+Math.min(p,a));


  }
} Main
import java.util.*;
import java.math.*;

public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long n = sc.nextLong();
    long a = sc.nextLong();
    long b = sc.nextLong();

    long sum = a+b;

    long w = n/sum;
    long p = n%sum;


    System.out.println(w*a+Math.min(p,a));


  }
}
