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