
import java.lang.Math;
import java.util.Scanner;
class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long blue = sc.nextLong();
        long red  = sc.nextLong();
        long l = n/(blue+red)*blue;
        long rem = n%(red+blue);
        l += Math.min(rem, blue);
        System.out.println(l);
    }
} import java.lang.Math; Math java.lang import java.util.Scanner; Scanner java.util class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long blue = sc.nextLong();
        long red  = sc.nextLong();
        long l = n/(blue+red)*blue;
        long rem = n%(red+blue);
        l += Math.min(rem, blue);
        System.out.println(l);
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long blue = sc.nextLong();
        long red  = sc.nextLong();
        long l = n/(blue+red)*blue;
        long rem = n%(red+blue);
        l += Math.min(rem, blue);
        System.out.println(l);
    } main {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long blue = sc.nextLong();
        long red  = sc.nextLong();
        long l = n/(blue+red)*blue;
        long rem = n%(red+blue);
        l += Math.min(rem, blue);
        System.out.println(l);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long n = sc.nextLong(); n sc.nextLong() sc.nextLong sc long blue = sc.nextLong(); blue sc.nextLong() sc.nextLong sc long red  = sc.nextLong(); red sc.nextLong() sc.nextLong sc long l = n/(blue+red)*blue; l n/(blue+red)*blue n/(blue+red) n (blue+red) blue red blue long rem = n%(red+blue); rem n%(red+blue) n (red+blue) red blue l += Math.min(rem, blue) l Math.min(rem, blue) Math.min Math rem blue System.out.println(l) System.out.println System.out System System.out l String[] args args

import java.lang.Math;
import java.util.Scanner;
class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long blue = sc.nextLong();
        long red  = sc.nextLong();
        long l = n/(blue+red)*blue;
        long rem = n%(red+blue);
        l += Math.min(rem, blue);
        System.out.println(l);
    }
}