import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

  public static void main(String[] args) throws Exception {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String[] data = br.readLine().split(" ");
    br.close();
    long n = Long.parseLong(data[0]);
    long a = Long.parseLong(data[1]);
    long b = Long.parseLong(data[2]);
    long answer = n / (a + b) * a;
    answer += Math.min(a, n % (a + b));
    System.out.println(answer);
  }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

  public static void main(String[] args) throws Exception {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String[] data = br.readLine().split(" ");
    br.close();
    long n = Long.parseLong(data[0]);
    long a = Long.parseLong(data[1]);
    long b = Long.parseLong(data[2]);
    long answer = n / (a + b) * a;
    answer += Math.min(a, n % (a + b));
    System.out.println(answer);
  }
} Main public static void main(String[] args) throws Exception {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String[] data = br.readLine().split(" ");
    br.close();
    long n = Long.parseLong(data[0]);
    long a = Long.parseLong(data[1]);
    long b = Long.parseLong(data[2]);
    long answer = n / (a + b) * a;
    answer += Math.min(a, n % (a + b));
    System.out.println(answer);
  } main {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String[] data = br.readLine().split(" ");
    br.close();
    long n = Long.parseLong(data[0]);
    long a = Long.parseLong(data[1]);
    long b = Long.parseLong(data[2]);
    long answer = n / (a + b) * a;
    answer += Math.min(a, n % (a + b));
    System.out.println(answer);
  } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String[] data = br.readLine().split(" "); data br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " br.close() br.close br long n = Long.parseLong(data[0]); n Long.parseLong(data[0]) Long.parseLong Long data[0] data 0 long a = Long.parseLong(data[1]); a Long.parseLong(data[1]) Long.parseLong Long data[1] data 1 long b = Long.parseLong(data[2]); b Long.parseLong(data[2]) Long.parseLong Long data[2] data 2 long answer = n / (a + b) * a; answer n / (a + b) * a n / (a + b) n (a + b) a b a answer += Math.min(a, n % (a + b)) answer Math.min(a, n % (a + b)) Math.min Math a n % (a + b) n (a + b) a b System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main {

  public static void main(String[] args) throws Exception {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String[] data = br.readLine().split(" ");
    br.close();
    long n = Long.parseLong(data[0]);
    long a = Long.parseLong(data[1]);
    long b = Long.parseLong(data[2]);
    long answer = n / (a + b) * a;
    answer += Math.min(a, n % (a + b));
    System.out.println(answer);
  }
} public class Main {

  public static void main(String[] args) throws Exception {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String[] data = br.readLine().split(" ");
    br.close();
    long n = Long.parseLong(data[0]);
    long a = Long.parseLong(data[1]);
    long b = Long.parseLong(data[2]);
    long answer = n / (a + b) * a;
    answer += Math.min(a, n % (a + b));
    System.out.println(answer);
  }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

  public static void main(String[] args) throws Exception {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String[] data = br.readLine().split(" ");
    br.close();
    long n = Long.parseLong(data[0]);
    long a = Long.parseLong(data[1]);
    long b = Long.parseLong(data[2]);
    long answer = n / (a + b) * a;
    answer += Math.min(a, n % (a + b));
    System.out.println(answer);
  }
}
