import java.util.Scanner;

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

        long result1 = n / (a + b) * a;
        long result2 = Math.min(n % (a + b), a);
        System.out.println(result1 + result2);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long n = scanner.nextLong();
        long a = scanner.nextLong();
        long b = scanner.nextLong();

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

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

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

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

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

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

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