
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        long n=scanner.nextLong();
        long a=scanner.nextLong();
        long b=scanner.nextLong();
        long aa=n%(long)((long)a+(long)b);
        long as=(long)((long)n/(long)((long)a+(long)b));
        long ans=(long)((long)((long)as*(long)a)+ (long)Math.min((long)aa,(long)a));
        System.out.println(ans);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        long n=scanner.nextLong();
        long a=scanner.nextLong();
        long b=scanner.nextLong();
        long aa=n%(long)((long)a+(long)b);
        long as=(long)((long)n/(long)((long)a+(long)b));
        long ans=(long)((long)((long)as*(long)a)+ (long)Math.min((long)aa,(long)a));
        System.out.println(ans);
    }
} Main public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        long n=scanner.nextLong();
        long a=scanner.nextLong();
        long b=scanner.nextLong();
        long aa=n%(long)((long)a+(long)b);
        long as=(long)((long)n/(long)((long)a+(long)b));
        long ans=(long)((long)((long)as*(long)a)+ (long)Math.min((long)aa,(long)a));
        System.out.println(ans);
    } main {
        Scanner scanner=new Scanner(System.in);
        long n=scanner.nextLong();
        long a=scanner.nextLong();
        long b=scanner.nextLong();
        long aa=n%(long)((long)a+(long)b);
        long as=(long)((long)n/(long)((long)a+(long)b));
        long ans=(long)((long)((long)as*(long)a)+ (long)Math.min((long)aa,(long)a));
        System.out.println(ans);
    } Scanner scanner=new Scanner(System.in); scanner new Scanner(System.in) long n=scanner.nextLong(); n scanner.nextLong() scanner.nextLong scanner long a=scanner.nextLong(); a scanner.nextLong() scanner.nextLong scanner long b=scanner.nextLong(); b scanner.nextLong() scanner.nextLong scanner long aa=n%(long)((long)a+(long)b); aa n%(long)((long)a+(long)b) n (long)((long)a+(long)b) (long)a (long)b long as=(long)((long)n/(long)((long)a+(long)b)); as (long)((long)n/(long)((long)a+(long)b)) (long)n (long)((long)a+(long)b) (long)a (long)b long ans=(long)((long)((long)as*(long)a)+ (long)Math.min((long)aa,(long)a)); ans (long)((long)((long)as*(long)a)+ (long)Math.min((long)aa,(long)a)) (long)((long)as*(long)a) (long)as (long)a (long)Math.min((long)aa,(long)a) Math.min Math (long)aa (long)a 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 scanner=new Scanner(System.in);
        long n=scanner.nextLong();
        long a=scanner.nextLong();
        long b=scanner.nextLong();
        long aa=n%(long)((long)a+(long)b);
        long as=(long)((long)n/(long)((long)a+(long)b));
        long ans=(long)((long)((long)as*(long)a)+ (long)Math.min((long)aa,(long)a));
        System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        long n=scanner.nextLong();
        long a=scanner.nextLong();
        long b=scanner.nextLong();
        long aa=n%(long)((long)a+(long)b);
        long as=(long)((long)n/(long)((long)a+(long)b));
        long ans=(long)((long)((long)as*(long)a)+ (long)Math.min((long)aa,(long)a));
        System.out.println(ans);
    }
} Main

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        long n=scanner.nextLong();
        long a=scanner.nextLong();
        long b=scanner.nextLong();
        long aa=n%(long)((long)a+(long)b);
        long as=(long)((long)n/(long)((long)a+(long)b));
        long ans=(long)((long)((long)as*(long)a)+ (long)Math.min((long)aa,(long)a));
        System.out.println(ans);
    }
}
