import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner scan = new java.util.Scanner(System.in);
        long n = scan.nextLong(),
             a = scan.nextLong(),
             b = scan.nextLong(),
             c = n % (a + b);
        System.out.println(
        	(n / (a + b)) * a + (c <= a ? c: a)
        );
    }
} import java.util.*; util.* java public class Main{
    public static void main(String[] args){
        Scanner scan = new java.util.Scanner(System.in);
        long n = scan.nextLong(),
             a = scan.nextLong(),
             b = scan.nextLong(),
             c = n % (a + b);
        System.out.println(
        	(n / (a + b)) * a + (c <= a ? c: a)
        );
    }
} Main public static void main(String[] args){
        Scanner scan = new java.util.Scanner(System.in);
        long n = scan.nextLong(),
             a = scan.nextLong(),
             b = scan.nextLong(),
             c = n % (a + b);
        System.out.println(
        	(n / (a + b)) * a + (c <= a ? c: a)
        );
    } main {
        Scanner scan = new java.util.Scanner(System.in);
        long n = scan.nextLong(),
             a = scan.nextLong(),
             b = scan.nextLong(),
             c = n % (a + b);
        System.out.println(
        	(n / (a + b)) * a + (c <= a ? c: a)
        );
    } Scanner scan = new java.util.Scanner(System.in); scan new java.util.Scanner(System.in) long n = scan.nextLong() n scan.nextLong() scan.nextLong scan a = scan.nextLong() a scan.nextLong() scan.nextLong scan b = scan.nextLong() b scan.nextLong() scan.nextLong scan c = n % (a + b); c n % (a + b) n (a + b) a b System.out.println(
        	(n / (a + b)) * a + (c <= a ? c: a)
        ) System.out.println System.out System System.out (n / (a + b)) * a + (c <= a ? c: a) (n / (a + b)) * a (n / (a + b)) n (a + b) a b a (c <= a ? c: a) c <= a c a c a String[] args args public class Main{
    public static void main(String[] args){
        Scanner scan = new java.util.Scanner(System.in);
        long n = scan.nextLong(),
             a = scan.nextLong(),
             b = scan.nextLong(),
             c = n % (a + b);
        System.out.println(
        	(n / (a + b)) * a + (c <= a ? c: a)
        );
    }
} public class Main{
    public static void main(String[] args){
        Scanner scan = new java.util.Scanner(System.in);
        long n = scan.nextLong(),
             a = scan.nextLong(),
             b = scan.nextLong(),
             c = n % (a + b);
        System.out.println(
        	(n / (a + b)) * a + (c <= a ? c: a)
        );
    }
} Main
import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner scan = new java.util.Scanner(System.in);
        long n = scan.nextLong(),
             a = scan.nextLong(),
             b = scan.nextLong(),
             c = n % (a + b);
        System.out.println(
        	(n / (a + b)) * a + (c <= a ? c: a)
        );
    }
}