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