import java.util.Scanner;
 
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 x = N / (A + B);
    long y = N % (A + B);
    System.out.println(x * A + Math.min(y, A));
  }
} import java.util.Scanner; Scanner java.util 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 x = N / (A + B);
    long y = N % (A + B);
    System.out.println(x * A + Math.min(y, 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 x = N / (A + B);
    long y = N % (A + B);
    System.out.println(x * A + Math.min(y, A));
  } main {
    Scanner sc = new Scanner(System.in);
    long N = sc.nextLong();
    long A = sc.nextLong();
    long B = sc.nextLong();
    long x = N / (A + B);
    long y = N % (A + B);
    System.out.println(x * A + Math.min(y, 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 x = N / (A + B); x N / (A + B) N (A + B) A B long y = N % (A + B); y N % (A + B) N (A + B) A B System.out.println(x * A + Math.min(y, A)) System.out.println System.out System System.out x * A + Math.min(y, A) x * A x A Math.min(y, A) Math.min Math y 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 x = N / (A + B);
    long y = N % (A + B);
    System.out.println(x * A + Math.min(y, 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 x = N / (A + B);
    long y = N % (A + B);
    System.out.println(x * A + Math.min(y, A));
  }
} Main
import java.util.Scanner;
 
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 x = N / (A + B);
    long y = N % (A + B);
    System.out.println(x * A + Math.min(y, A));
  }
}