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 c = n / (a+b);
        long d = n % (a+b);
        if(c < 1) {
            System.out.println(Math.min(a, n));
        } else {
            long e = n % (a+b);
            long f = Math.min(e, a);
            System.out.println(c * a + f);
        }
    }
} 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 c = n / (a+b);
        long d = n % (a+b);
        if(c < 1) {
            System.out.println(Math.min(a, n));
        } else {
            long e = n % (a+b);
            long f = Math.min(e, a);
            System.out.println(c * a + f);
        }
    }
} 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 c = n / (a+b);
        long d = n % (a+b);
        if(c < 1) {
            System.out.println(Math.min(a, n));
        } else {
            long e = n % (a+b);
            long f = Math.min(e, a);
            System.out.println(c * a + f);
        }
    } main {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();

        long c = n / (a+b);
        long d = n % (a+b);
        if(c < 1) {
            System.out.println(Math.min(a, n));
        } else {
            long e = n % (a+b);
            long f = Math.min(e, a);
            System.out.println(c * a + f);
        }
    } 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 c = n / (a+b); c n / (a+b) n (a+b) a b long d = n % (a+b); d n % (a+b) n (a+b) a b if(c < 1) {
            System.out.println(Math.min(a, n));
        } else {
            long e = n % (a+b);
            long f = Math.min(e, a);
            System.out.println(c * a + f);
        } c < 1 c 1 {
            System.out.println(Math.min(a, n));
        } System.out.println(Math.min(a, n)) System.out.println System.out System System.out Math.min(a, n) Math.min Math a n {
            long e = n % (a+b);
            long f = Math.min(e, a);
            System.out.println(c * a + f);
        } long e = n % (a+b); e n % (a+b) n (a+b) a b long f = Math.min(e, a); f Math.min(e, a) Math.min Math e a System.out.println(c * a + f) System.out.println System.out System System.out c * a + f c * a c a f 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 c = n / (a+b);
        long d = n % (a+b);
        if(c < 1) {
            System.out.println(Math.min(a, n));
        } else {
            long e = n % (a+b);
            long f = Math.min(e, a);
            System.out.println(c * a + f);
        }
    }
} 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 c = n / (a+b);
        long d = n % (a+b);
        if(c < 1) {
            System.out.println(Math.min(a, n));
        } else {
            long e = n % (a+b);
            long f = Math.min(e, a);
            System.out.println(c * a + f);
        }
    }
} 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 c = n / (a+b);
        long d = n % (a+b);
        if(c < 1) {
            System.out.println(Math.min(a, n));
        } else {
            long e = n % (a+b);
            long f = Math.min(e, a);
            System.out.println(c * a + f);
        }
    }
}