import java.util.*;
import java.lang.*;

public class Main {

    public static void main (String[] args) {
        Scanner in = new Scanner(System.in);
        long n = in.nextLong();
        long a = in.nextLong();
        long b = in.nextLong();

        long i = n / (a + b) * a;
        long j = Math.min(n % (a + b), a);
        System.out.println(i + j);
    }
} import java.util.*; util.* java import java.lang.*; lang.* java public class Main {

    public static void main (String[] args) {
        Scanner in = new Scanner(System.in);
        long n = in.nextLong();
        long a = in.nextLong();
        long b = in.nextLong();

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

        long i = n / (a + b) * a;
        long j = Math.min(n % (a + b), a);
        System.out.println(i + j);
    } main {
        Scanner in = new Scanner(System.in);
        long n = in.nextLong();
        long a = in.nextLong();
        long b = in.nextLong();

        long i = n / (a + b) * a;
        long j = Math.min(n % (a + b), a);
        System.out.println(i + j);
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) long n = in.nextLong(); n in.nextLong() in.nextLong in long a = in.nextLong(); a in.nextLong() in.nextLong in long b = in.nextLong(); b in.nextLong() in.nextLong in long i = n / (a + b) * a; i n / (a + b) * a n / (a + b) n (a + b) a b a long j = Math.min(n % (a + b), a); j Math.min(n % (a + b), a) Math.min Math n % (a + b) n (a + b) a b a System.out.println(i + j) System.out.println System.out System System.out i + j i j String[] args args public class Main {

    public static void main (String[] args) {
        Scanner in = new Scanner(System.in);
        long n = in.nextLong();
        long a = in.nextLong();
        long b = in.nextLong();

        long i = n / (a + b) * a;
        long j = Math.min(n % (a + b), a);
        System.out.println(i + j);
    }
} public class Main {

    public static void main (String[] args) {
        Scanner in = new Scanner(System.in);
        long n = in.nextLong();
        long a = in.nextLong();
        long b = in.nextLong();

        long i = n / (a + b) * a;
        long j = Math.min(n % (a + b), a);
        System.out.println(i + j);
    }
} Main
import java.util.*;
import java.lang.*;

public class Main {

    public static void main (String[] args) {
        Scanner in = new Scanner(System.in);
        long n = in.nextLong();
        long a = in.nextLong();
        long b = in.nextLong();

        long i = n / (a + b) * a;
        long j = Math.min(n % (a + b), a);
        System.out.println(i + j);
    }
}