import java.util.Scanner;
 
public class Main {
 
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long n = scanner.nextLong();
        long a = scanner.nextLong();
        long b = scanner.nextLong();
        if (a == 0) {
            System.out.println("0");
            return;
        }
        long d = a + b;
        long q = n / d;
        long r = n % d;
        long blue = (q * a) + (a < r ? a : r);
        System.out.println(blue);
    }
} import java.util.Scanner; Scanner java.util public class Main {
 
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long n = scanner.nextLong();
        long a = scanner.nextLong();
        long b = scanner.nextLong();
        if (a == 0) {
            System.out.println("0");
            return;
        }
        long d = a + b;
        long q = n / d;
        long r = n % d;
        long blue = (q * a) + (a < r ? a : r);
        System.out.println(blue);
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long n = scanner.nextLong();
        long a = scanner.nextLong();
        long b = scanner.nextLong();
        if (a == 0) {
            System.out.println("0");
            return;
        }
        long d = a + b;
        long q = n / d;
        long r = n % d;
        long blue = (q * a) + (a < r ? a : r);
        System.out.println(blue);
    } main {
        Scanner scanner = new Scanner(System.in);
        long n = scanner.nextLong();
        long a = scanner.nextLong();
        long b = scanner.nextLong();
        if (a == 0) {
            System.out.println("0");
            return;
        }
        long d = a + b;
        long q = n / d;
        long r = n % d;
        long blue = (q * a) + (a < r ? a : r);
        System.out.println(blue);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) long n = scanner.nextLong(); n scanner.nextLong() scanner.nextLong scanner long a = scanner.nextLong(); a scanner.nextLong() scanner.nextLong scanner long b = scanner.nextLong(); b scanner.nextLong() scanner.nextLong scanner if (a == 0) {
            System.out.println("0");
            return;
        } a == 0 a 0 {
            System.out.println("0");
            return;
        } System.out.println("0") System.out.println System.out System System.out "0" return; long d = a + b; d a + b a b long q = n / d; q n / d n d long r = n % d; r n % d n d long blue = (q * a) + (a < r ? a : r); blue (q * a) + (a < r ? a : r) (q * a) q a (a < r ? a : r) a < r a r a r System.out.println(blue) System.out.println System.out System System.out blue String[] args args public class Main {
 
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long n = scanner.nextLong();
        long a = scanner.nextLong();
        long b = scanner.nextLong();
        if (a == 0) {
            System.out.println("0");
            return;
        }
        long d = a + b;
        long q = n / d;
        long r = n % d;
        long blue = (q * a) + (a < r ? a : r);
        System.out.println(blue);
    }
} public class Main {
 
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long n = scanner.nextLong();
        long a = scanner.nextLong();
        long b = scanner.nextLong();
        if (a == 0) {
            System.out.println("0");
            return;
        }
        long d = a + b;
        long q = n / d;
        long r = n % d;
        long blue = (q * a) + (a < r ? a : r);
        System.out.println(blue);
    }
} Main
import java.util.Scanner;
 
public class Main {
 
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long n = scanner.nextLong();
        long a = scanner.nextLong();
        long b = scanner.nextLong();
        if (a == 0) {
            System.out.println("0");
            return;
        }
        long d = a + b;
        long q = n / d;
        long r = n % d;
        long blue = (q * a) + (a < r ? a : r);
        System.out.println(blue);
    }
}