import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        long N, A, B;
        Scanner sc = new Scanner(System.in);
        N = sc.nextLong();
        A = sc.nextLong();
        B = sc.nextLong();
      long n1 = N/(A+B);
        long n2 = N%(A+B);
        
        System.out.println(A*n1+(n2>=A?A:n2));
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        long N, A, B;
        Scanner sc = new Scanner(System.in);
        N = sc.nextLong();
        A = sc.nextLong();
        B = sc.nextLong();
      long n1 = N/(A+B);
        long n2 = N%(A+B);
        
        System.out.println(A*n1+(n2>=A?A:n2));
    }
} Main public static void main(String[] args) {
        long N, A, B;
        Scanner sc = new Scanner(System.in);
        N = sc.nextLong();
        A = sc.nextLong();
        B = sc.nextLong();
      long n1 = N/(A+B);
        long n2 = N%(A+B);
        
        System.out.println(A*n1+(n2>=A?A:n2));
    } main {
        long N, A, B;
        Scanner sc = new Scanner(System.in);
        N = sc.nextLong();
        A = sc.nextLong();
        B = sc.nextLong();
      long n1 = N/(A+B);
        long n2 = N%(A+B);
        
        System.out.println(A*n1+(n2>=A?A:n2));
    } long N N A A B; B Scanner sc = new Scanner(System.in); sc new Scanner(System.in) N = sc.nextLong() N sc.nextLong() sc.nextLong sc A = sc.nextLong() A sc.nextLong() sc.nextLong sc B = sc.nextLong() B sc.nextLong() sc.nextLong sc long n1 = N/(A+B); n1 N/(A+B) N (A+B) A B long n2 = N%(A+B); n2 N%(A+B) N (A+B) A B System.out.println(A*n1+(n2>=A?A:n2)) System.out.println System.out System System.out A*n1+(n2>=A?A:n2) A*n1 A n1 (n2>=A?A:n2) n2>=A n2 A A n2 String[] args args public class Main {
    public static void main(String[] args) {
        long N, A, B;
        Scanner sc = new Scanner(System.in);
        N = sc.nextLong();
        A = sc.nextLong();
        B = sc.nextLong();
      long n1 = N/(A+B);
        long n2 = N%(A+B);
        
        System.out.println(A*n1+(n2>=A?A:n2));
    }
} public class Main {
    public static void main(String[] args) {
        long N, A, B;
        Scanner sc = new Scanner(System.in);
        N = sc.nextLong();
        A = sc.nextLong();
        B = sc.nextLong();
      long n1 = N/(A+B);
        long n2 = N%(A+B);
        
        System.out.println(A*n1+(n2>=A?A:n2));
    }
} Main
import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        long N, A, B;
        Scanner sc = new Scanner(System.in);
        N = sc.nextLong();
        A = sc.nextLong();
        B = sc.nextLong();
      long n1 = N/(A+B);
        long n2 = N%(A+B);
        
        System.out.println(A*n1+(n2>=A?A:n2));
    }
}