import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String data = sc.nextLine();
        
        String[] array = data.split(" ");
        long n = Long.parseLong(array[0]);
        long a = Long.parseLong(array[1]);
        long b = Long.parseLong(array[2]);
        
        long count = n / (a + b);
        long amari = n % (a + b);
        
        long blue = count * a;
        if(amari <= a)
        {
            blue += amari;
        }
        else
        {
            blue += a;
        }
        
        System.out.println(blue);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String data = sc.nextLine();
        
        String[] array = data.split(" ");
        long n = Long.parseLong(array[0]);
        long a = Long.parseLong(array[1]);
        long b = Long.parseLong(array[2]);
        
        long count = n / (a + b);
        long amari = n % (a + b);
        
        long blue = count * a;
        if(amari <= a)
        {
            blue += amari;
        }
        else
        {
            blue += a;
        }
        
        System.out.println(blue);
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String data = sc.nextLine();
        
        String[] array = data.split(" ");
        long n = Long.parseLong(array[0]);
        long a = Long.parseLong(array[1]);
        long b = Long.parseLong(array[2]);
        
        long count = n / (a + b);
        long amari = n % (a + b);
        
        long blue = count * a;
        if(amari <= a)
        {
            blue += amari;
        }
        else
        {
            blue += a;
        }
        
        System.out.println(blue);
    } main {
        Scanner sc = new Scanner(System.in);
        String data = sc.nextLine();
        
        String[] array = data.split(" ");
        long n = Long.parseLong(array[0]);
        long a = Long.parseLong(array[1]);
        long b = Long.parseLong(array[2]);
        
        long count = n / (a + b);
        long amari = n % (a + b);
        
        long blue = count * a;
        if(amari <= a)
        {
            blue += amari;
        }
        else
        {
            blue += a;
        }
        
        System.out.println(blue);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String data = sc.nextLine(); data sc.nextLine() sc.nextLine sc String[] array = data.split(" "); array data.split(" ") data.split data " " long n = Long.parseLong(array[0]); n Long.parseLong(array[0]) Long.parseLong Long array[0] array 0 long a = Long.parseLong(array[1]); a Long.parseLong(array[1]) Long.parseLong Long array[1] array 1 long b = Long.parseLong(array[2]); b Long.parseLong(array[2]) Long.parseLong Long array[2] array 2 long count = n / (a + b); count n / (a + b) n (a + b) a b long amari = n % (a + b); amari n % (a + b) n (a + b) a b long blue = count * a; blue count * a count a if(amari <= a)
        {
            blue += amari;
        }
        else
        {
            blue += a;
        } amari <= a amari a {
            blue += amari;
        } blue += amari blue amari {
            blue += a;
        } blue += a blue a System.out.println(blue) System.out.println System.out System System.out blue String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String data = sc.nextLine();
        
        String[] array = data.split(" ");
        long n = Long.parseLong(array[0]);
        long a = Long.parseLong(array[1]);
        long b = Long.parseLong(array[2]);
        
        long count = n / (a + b);
        long amari = n % (a + b);
        
        long blue = count * a;
        if(amari <= a)
        {
            blue += amari;
        }
        else
        {
            blue += a;
        }
        
        System.out.println(blue);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String data = sc.nextLine();
        
        String[] array = data.split(" ");
        long n = Long.parseLong(array[0]);
        long a = Long.parseLong(array[1]);
        long b = Long.parseLong(array[2]);
        
        long count = n / (a + b);
        long amari = n % (a + b);
        
        long blue = count * a;
        if(amari <= a)
        {
            blue += amari;
        }
        else
        {
            blue += a;
        }
        
        System.out.println(blue);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String data = sc.nextLine();
        
        String[] array = data.split(" ");
        long n = Long.parseLong(array[0]);
        long a = Long.parseLong(array[1]);
        long b = Long.parseLong(array[2]);
        
        long count = n / (a + b);
        long amari = n % (a + b);
        
        long blue = count * a;
        if(amari <= a)
        {
            blue += amari;
        }
        else
        {
            blue += a;
        }
        
        System.out.println(blue);
    }
}
