import 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 syou = N/(A+B);
        long amari = N%(A+B);
        if(amari<=A){
            System.out.println(A*syou + amari);
        }else{
            System.out.println(A*syou + A);
        }
     }
}

 import java.util.*; util.* java 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 syou = N/(A+B);
        long amari = N%(A+B);
        if(amari<=A){
            System.out.println(A*syou + amari);
        }else{
            System.out.println(A*syou + 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();

        long syou = N/(A+B);
        long amari = N%(A+B);
        if(amari<=A){
            System.out.println(A*syou + amari);
        }else{
            System.out.println(A*syou + A);
        }
     } main {
    
    Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long A = sc.nextLong();
        long B = sc.nextLong();

        long syou = N/(A+B);
        long amari = N%(A+B);
        if(amari<=A){
            System.out.println(A*syou + amari);
        }else{
            System.out.println(A*syou + 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 long syou = N/(A+B); syou N/(A+B) N (A+B) A B long amari = N%(A+B); amari N%(A+B) N (A+B) A B if(amari<=A){
            System.out.println(A*syou + amari);
        }else{
            System.out.println(A*syou + A);
        } amari<=A amari A {
            System.out.println(A*syou + amari);
        } System.out.println(A*syou + amari) System.out.println System.out System System.out A*syou + amari A*syou A syou amari {
            System.out.println(A*syou + A);
        } System.out.println(A*syou + A) System.out.println System.out System System.out A*syou + A A*syou A syou 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();

        long syou = N/(A+B);
        long amari = N%(A+B);
        if(amari<=A){
            System.out.println(A*syou + amari);
        }else{
            System.out.println(A*syou + 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();

        long syou = N/(A+B);
        long amari = N%(A+B);
        if(amari<=A){
            System.out.println(A*syou + amari);
        }else{
            System.out.println(A*syou + A);
        }
     }
} Main
import 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 syou = N/(A+B);
        long amari = N%(A+B);
        if(amari<=A){
            System.out.println(A*syou + amari);
        }else{
            System.out.println(A*syou + A);
        }
     }
}


