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 s = n % (a + b), t = n / (a + b), sum = 0;
        sum += a * t;
        sum += (s > a)? a:s;
        System.out.println(sum);
    }
} 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 s = n % (a + b), t = n / (a + b), sum = 0;
        sum += a * t;
        sum += (s > a)? a:s;
        System.out.println(sum);
    }
} 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 s = n % (a + b), t = n / (a + b), sum = 0;
        sum += a * t;
        sum += (s > a)? a:s;
        System.out.println(sum);
    } main {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();
        long s = n % (a + b), t = n / (a + b), sum = 0;
        sum += a * t;
        sum += (s > a)? a:s;
        System.out.println(sum);
    } 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 s = n % (a + b) s n % (a + b) n (a + b) a b t = n / (a + b) t n / (a + b) n (a + b) a b sum = 0; sum 0 sum += a * t sum a * t a t sum += (s > a)? a:s sum (s > a)? a:s (s > a) s a a s System.out.println(sum) System.out.println System.out System System.out sum 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 s = n % (a + b), t = n / (a + b), sum = 0;
        sum += a * t;
        sum += (s > a)? a:s;
        System.out.println(sum);
    }
} 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 s = n % (a + b), t = n / (a + b), sum = 0;
        sum += a * t;
        sum += (s > a)? a:s;
        System.out.println(sum);
    }
} 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 s = n % (a + b), t = n / (a + b), sum = 0;
        sum += a * t;
        sum += (s > a)? a:s;
        System.out.println(sum);
    }
}
