import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();
        
        long c = n / (a+b);
        long d = n % (a+b);
        long e = Math.min(a, d);
        System.out.println(c * a + e);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();
        
        long c = n / (a+b);
        long d = n % (a+b);
        long e = Math.min(a, d);
        System.out.println(c * a + e);
    }
} Main public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();
        
        long c = n / (a+b);
        long d = n % (a+b);
        long e = Math.min(a, d);
        System.out.println(c * a + e);
    } main {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();
        
        long c = n / (a+b);
        long d = n % (a+b);
        long e = Math.min(a, d);
        System.out.println(c * a + e);
    } 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 c = n / (a+b); c n / (a+b) n (a+b) a b long d = n % (a+b); d n % (a+b) n (a+b) a b long e = Math.min(a, d); e Math.min(a, d) Math.min Math a d System.out.println(c * a + e) System.out.println System.out System System.out c * a + e c * a c a e String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();
        
        long c = n / (a+b);
        long d = n % (a+b);
        long e = Math.min(a, d);
        System.out.println(c * a + e);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();
        
        long c = n / (a+b);
        long d = n % (a+b);
        long e = Math.min(a, d);
        System.out.println(c * a + e);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();
        
        long c = n / (a+b);
        long d = n % (a+b);
        long e = Math.min(a, d);
        System.out.println(c * a + e);
    }
}
