import java.util.*;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long b = sc.nextLong();
        long r = sc.nextLong();
        long sum = b+r;

        long ans = 0;
        ans = (n/sum)*b;
        ans = ans+(Math.min(n%sum,b));

        
        System.out.println(ans);
    }
} 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 b = sc.nextLong();
        long r = sc.nextLong();
        long sum = b+r;

        long ans = 0;
        ans = (n/sum)*b;
        ans = ans+(Math.min(n%sum,b));

        
        System.out.println(ans);
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long b = sc.nextLong();
        long r = sc.nextLong();
        long sum = b+r;

        long ans = 0;
        ans = (n/sum)*b;
        ans = ans+(Math.min(n%sum,b));

        
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long b = sc.nextLong();
        long r = sc.nextLong();
        long sum = b+r;

        long ans = 0;
        ans = (n/sum)*b;
        ans = ans+(Math.min(n%sum,b));

        
        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 sum = b+r; sum b+r b r long ans = 0; ans 0 ans = (n/sum)*b ans (n/sum)*b (n/sum) n sum b ans = ans+(Math.min(n%sum,b)) ans ans+(Math.min(n%sum,b)) ans (Math.min(n%sum,b)) Math.min Math n%sum n sum b 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){
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long b = sc.nextLong();
        long r = sc.nextLong();
        long sum = b+r;

        long ans = 0;
        ans = (n/sum)*b;
        ans = ans+(Math.min(n%sum,b));

        
        System.out.println(ans);
    }
} public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long b = sc.nextLong();
        long r = sc.nextLong();
        long sum = b+r;

        long ans = 0;
        ans = (n/sum)*b;
        ans = ans+(Math.min(n%sum,b));

        
        System.out.println(ans);
    }
} Main
import java.util.*;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long b = sc.nextLong();
        long r = sc.nextLong();
        long sum = b+r;

        long ans = 0;
        ans = (n/sum)*b;
        ans = ans+(Math.min(n%sum,b));

        
        System.out.println(ans);
    }
}
