import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();
        System.out.println(n / (a + b) * a + Math.min(n % (a + b), a));
    }

} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();
        System.out.println(n / (a + b) * a + Math.min(n % (a + b), a));
    }

} Main public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();
        System.out.println(n / (a + b) * a + Math.min(n % (a + b), a));
    } main {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();
        System.out.println(n / (a + b) * a + Math.min(n % (a + b), a));
    } @SuppressWarnings("resource")
        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 System.out.println(n / (a + b) * a + Math.min(n % (a + b), a)) System.out.println System.out System System.out n / (a + b) * a + Math.min(n % (a + b), a) n / (a + b) * a n / (a + b) n (a + b) a b a Math.min(n % (a + b), a) Math.min Math n % (a + b) n (a + b) a b a String[] args args public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();
        System.out.println(n / (a + b) * a + Math.min(n % (a + b), a));
    }

} public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();
        System.out.println(n / (a + b) * a + Math.min(n % (a + b), a));
    }

} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();
        System.out.println(n / (a + b) * a + Math.min(n % (a + b), a));
    }

}
