import java.util.Scanner;

public class Main {

    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();
        long res = 0;

        long remainder = n % (a + b);
        if(remainder >= a) res += a;
        else res += remainder;

        res += (n / (a + b)) * a;
        System.out.println(res);
    }
} import java.util.Scanner; Scanner java.util public class Main {

    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();
        long res = 0;

        long remainder = n % (a + b);
        if(remainder >= a) res += a;
        else res += remainder;

        res += (n / (a + b)) * a;
        System.out.println(res);
    }
} Main static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) {
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();
        long res = 0;

        long remainder = n % (a + b);
        if(remainder >= a) res += a;
        else res += remainder;

        res += (n / (a + b)) * a;
        System.out.println(res);
    } main {
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();
        long res = 0;

        long remainder = n % (a + b);
        if(remainder >= a) res += a;
        else res += remainder;

        res += (n / (a + b)) * a;
        System.out.println(res);
    } 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 res = 0; res 0 long remainder = n % (a + b); remainder n % (a + b) n (a + b) a b if(remainder >= a) res += a;
        else res += remainder; remainder >= a remainder a res += a res a res += remainder res remainder res += (n / (a + b)) * a res (n / (a + b)) * a (n / (a + b)) n (a + b) a b a System.out.println(res) System.out.println System.out System System.out res String[] args args public class Main {

    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();
        long res = 0;

        long remainder = n % (a + b);
        if(remainder >= a) res += a;
        else res += remainder;

        res += (n / (a + b)) * a;
        System.out.println(res);
    }
} public class Main {

    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();
        long res = 0;

        long remainder = n % (a + b);
        if(remainder >= a) res += a;
        else res += remainder;

        res += (n / (a + b)) * a;
        System.out.println(res);
    }
} Main
import java.util.Scanner;

public class Main {

    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();
        long res = 0;

        long remainder = n % (a + b);
        if(remainder >= a) res += a;
        else res += remainder;

        res += (n / (a + b)) * a;
        System.out.println(res);
    }
}
