import java.util.*;
import java.lang.*;

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();
    sc.close();
    long C = A + B;
    long div = (N / C) * A;
    long mod = Math.min(N % (A + B), A);

    System.out.println(div + mod);
  }
} import java.util.*; util.* java import java.lang.*; lang.* 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();
    sc.close();
    long C = A + B;
    long div = (N / C) * A;
    long mod = Math.min(N % (A + B), A);

    System.out.println(div + mod);
  }
} 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();
    sc.close();
    long C = A + B;
    long div = (N / C) * A;
    long mod = Math.min(N % (A + B), A);

    System.out.println(div + mod);
  } main {
    Scanner sc = new Scanner(System.in);
    long N = sc.nextLong();
    long A = sc.nextLong();
    long B = sc.nextLong();
    sc.close();
    long C = A + B;
    long div = (N / C) * A;
    long mod = Math.min(N % (A + B), A);

    System.out.println(div + mod);
  } 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 sc.close() sc.close sc long C = A + B; C A + B A B long div = (N / C) * A; div (N / C) * A (N / C) N C A long mod = Math.min(N % (A + B), A); mod Math.min(N % (A + B), A) Math.min Math N % (A + B) N (A + B) A B A System.out.println(div + mod) System.out.println System.out System System.out div + mod div mod 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();
    sc.close();
    long C = A + B;
    long div = (N / C) * A;
    long mod = Math.min(N % (A + B), A);

    System.out.println(div + mod);
  }
} 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();
    sc.close();
    long C = A + B;
    long div = (N / C) * A;
    long mod = Math.min(N % (A + B), A);

    System.out.println(div + mod);
  }
} Main
import java.util.*;
import java.lang.*;

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();
    sc.close();
    long C = A + B;
    long div = (N / C) * A;
    long mod = Math.min(N % (A + B), A);

    System.out.println(div + mod);
  }
}