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();

        if(a+b==0){
            System.out.println(0);
            return;
        }

        long rem = n % (a+b);
        n -= rem;
        System.out.println(n/(a+b)*a + Math.min(rem,a));
    }
} 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();

        if(a+b==0){
            System.out.println(0);
            return;
        }

        long rem = n % (a+b);
        n -= rem;
        System.out.println(n/(a+b)*a + Math.min(rem,a));
    }
} 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();

        if(a+b==0){
            System.out.println(0);
            return;
        }

        long rem = n % (a+b);
        n -= rem;
        System.out.println(n/(a+b)*a + Math.min(rem,a));
    } main {

        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();

        if(a+b==0){
            System.out.println(0);
            return;
        }

        long rem = n % (a+b);
        n -= rem;
        System.out.println(n/(a+b)*a + Math.min(rem,a));
    } 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 if(a+b==0){
            System.out.println(0);
            return;
        } a+b==0 a+b a b 0 {
            System.out.println(0);
            return;
        } System.out.println(0) System.out.println System.out System System.out 0 return; long rem = n % (a+b); rem n % (a+b) n (a+b) a b n -= rem n rem System.out.println(n/(a+b)*a + Math.min(rem,a)) System.out.println System.out System System.out n/(a+b)*a + Math.min(rem,a) n/(a+b)*a n/(a+b) n (a+b) a b a Math.min(rem,a) Math.min Math rem a 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();

        if(a+b==0){
            System.out.println(0);
            return;
        }

        long rem = n % (a+b);
        n -= rem;
        System.out.println(n/(a+b)*a + Math.min(rem,a));
    }
} 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();

        if(a+b==0){
            System.out.println(0);
            return;
        }

        long rem = n % (a+b);
        n -= rem;
        System.out.println(n/(a+b)*a + Math.min(rem,a));
    }
} 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();

        if(a+b==0){
            System.out.println(0);
            return;
        }

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