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