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

public class Main {

  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    String[] S = scanner.nextLine().split(" ");
    scanner.close();
    BigInteger N = new BigInteger(S[0]);
    BigInteger A = new BigInteger(S[1]);
    BigInteger B = new BigInteger(S[2]);
    BigInteger step = A.add(B);
    BigInteger[] dr = N.divideAndRemainder(step);
    BigInteger remainder = dr[1].compareTo(A) >= 0 ? A : dr[1];
    BigInteger blueCount = A.multiply(dr[0]).add(remainder);
    System.out.println(blueCount.toString());
  }
} import java.math.BigInteger; BigInteger java.math import java.util.*; util.* java public class Main {

  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    String[] S = scanner.nextLine().split(" ");
    scanner.close();
    BigInteger N = new BigInteger(S[0]);
    BigInteger A = new BigInteger(S[1]);
    BigInteger B = new BigInteger(S[2]);
    BigInteger step = A.add(B);
    BigInteger[] dr = N.divideAndRemainder(step);
    BigInteger remainder = dr[1].compareTo(A) >= 0 ? A : dr[1];
    BigInteger blueCount = A.multiply(dr[0]).add(remainder);
    System.out.println(blueCount.toString());
  }
} Main public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    String[] S = scanner.nextLine().split(" ");
    scanner.close();
    BigInteger N = new BigInteger(S[0]);
    BigInteger A = new BigInteger(S[1]);
    BigInteger B = new BigInteger(S[2]);
    BigInteger step = A.add(B);
    BigInteger[] dr = N.divideAndRemainder(step);
    BigInteger remainder = dr[1].compareTo(A) >= 0 ? A : dr[1];
    BigInteger blueCount = A.multiply(dr[0]).add(remainder);
    System.out.println(blueCount.toString());
  } main {
    Scanner scanner = new Scanner(System.in);
    String[] S = scanner.nextLine().split(" ");
    scanner.close();
    BigInteger N = new BigInteger(S[0]);
    BigInteger A = new BigInteger(S[1]);
    BigInteger B = new BigInteger(S[2]);
    BigInteger step = A.add(B);
    BigInteger[] dr = N.divideAndRemainder(step);
    BigInteger remainder = dr[1].compareTo(A) >= 0 ? A : dr[1];
    BigInteger blueCount = A.multiply(dr[0]).add(remainder);
    System.out.println(blueCount.toString());
  } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String[] S = scanner.nextLine().split(" "); S scanner.nextLine().split(" ") scanner.nextLine().split scanner.nextLine() scanner.nextLine scanner " " scanner.close() scanner.close scanner BigInteger N = new BigInteger(S[0]); N new BigInteger(S[0]) BigInteger A = new BigInteger(S[1]); A new BigInteger(S[1]) BigInteger B = new BigInteger(S[2]); B new BigInteger(S[2]) BigInteger step = A.add(B); step A.add(B) A.add A B BigInteger[] dr = N.divideAndRemainder(step); dr N.divideAndRemainder(step) N.divideAndRemainder N step BigInteger remainder = dr[1].compareTo(A) >= 0 ? A : dr[1]; remainder dr[1].compareTo(A) >= 0 ? A : dr[1] dr[1].compareTo(A) >= 0 dr[1].compareTo(A) dr[1].compareTo dr[1] dr 1 A 0 A dr[1] dr 1 BigInteger blueCount = A.multiply(dr[0]).add(remainder); blueCount A.multiply(dr[0]).add(remainder) A.multiply(dr[0]).add A.multiply(dr[0]) A.multiply A dr[0] dr 0 remainder System.out.println(blueCount.toString()) System.out.println System.out System System.out blueCount.toString() blueCount.toString blueCount String[] args args public class Main {

  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    String[] S = scanner.nextLine().split(" ");
    scanner.close();
    BigInteger N = new BigInteger(S[0]);
    BigInteger A = new BigInteger(S[1]);
    BigInteger B = new BigInteger(S[2]);
    BigInteger step = A.add(B);
    BigInteger[] dr = N.divideAndRemainder(step);
    BigInteger remainder = dr[1].compareTo(A) >= 0 ? A : dr[1];
    BigInteger blueCount = A.multiply(dr[0]).add(remainder);
    System.out.println(blueCount.toString());
  }
} public class Main {

  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    String[] S = scanner.nextLine().split(" ");
    scanner.close();
    BigInteger N = new BigInteger(S[0]);
    BigInteger A = new BigInteger(S[1]);
    BigInteger B = new BigInteger(S[2]);
    BigInteger step = A.add(B);
    BigInteger[] dr = N.divideAndRemainder(step);
    BigInteger remainder = dr[1].compareTo(A) >= 0 ? A : dr[1];
    BigInteger blueCount = A.multiply(dr[0]).add(remainder);
    System.out.println(blueCount.toString());
  }
} Main
import java.math.BigInteger;
import java.util.*;

public class Main {

  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    String[] S = scanner.nextLine().split(" ");
    scanner.close();
    BigInteger N = new BigInteger(S[0]);
    BigInteger A = new BigInteger(S[1]);
    BigInteger B = new BigInteger(S[2]);
    BigInteger step = A.add(B);
    BigInteger[] dr = N.divideAndRemainder(step);
    BigInteger remainder = dr[1].compareTo(A) >= 0 ? A : dr[1];
    BigInteger blueCount = A.multiply(dr[0]).add(remainder);
    System.out.println(blueCount.toString());
  }
}