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 min_blue = a * (n / (a + b));
        if (n % (a + b) <= a) {
            System.out.println(min_blue + n % (a + b));
        } else {
            System.out.println(min_blue + a);
        }
        sc.close();
    }
} 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 min_blue = a * (n / (a + b));
        if (n % (a + b) <= a) {
            System.out.println(min_blue + n % (a + b));
        } else {
            System.out.println(min_blue + a);
        }
        sc.close();
    }
} 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 min_blue = a * (n / (a + b));
        if (n % (a + b) <= a) {
            System.out.println(min_blue + n % (a + b));
        } else {
            System.out.println(min_blue + a);
        }
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();
        long min_blue = a * (n / (a + b));
        if (n % (a + b) <= a) {
            System.out.println(min_blue + n % (a + b));
        } else {
            System.out.println(min_blue + a);
        }
        sc.close();
    } 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 min_blue = a * (n / (a + b)); min_blue a * (n / (a + b)) a (n / (a + b)) n (a + b) a b if (n % (a + b) <= a) {
            System.out.println(min_blue + n % (a + b));
        } else {
            System.out.println(min_blue + a);
        } n % (a + b) <= a n % (a + b) n (a + b) a b a {
            System.out.println(min_blue + n % (a + b));
        } System.out.println(min_blue + n % (a + b)) System.out.println System.out System System.out min_blue + n % (a + b) min_blue n % (a + b) n (a + b) a b {
            System.out.println(min_blue + a);
        } System.out.println(min_blue + a) System.out.println System.out System System.out min_blue + a min_blue a sc.close() sc.close sc 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 min_blue = a * (n / (a + b));
        if (n % (a + b) <= a) {
            System.out.println(min_blue + n % (a + b));
        } else {
            System.out.println(min_blue + a);
        }
        sc.close();
    }
} 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 min_blue = a * (n / (a + b));
        if (n % (a + b) <= a) {
            System.out.println(min_blue + n % (a + b));
        } else {
            System.out.println(min_blue + a);
        }
        sc.close();
    }
} 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 min_blue = a * (n / (a + b));
        if (n % (a + b) <= a) {
            System.out.println(min_blue + n % (a + b));
        } else {
            System.out.println(min_blue + a);
        }
        sc.close();
    }
}