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