
import java.util.*;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();

        double nn = Math.floor(n / (a+b) * 1.0);

        long blue = ((long)nn) * a;
        long red = ((long)nn) * b;

        if (blue + red + a <= n) blue += a;
        else blue += (n - (blue + red));

        System.out.println(blue);

    }
} 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 a = sc.nextLong();
        long b = sc.nextLong();

        double nn = Math.floor(n / (a+b) * 1.0);

        long blue = ((long)nn) * a;
        long red = ((long)nn) * b;

        if (blue + red + a <= n) blue += a;
        else blue += (n - (blue + red));

        System.out.println(blue);

    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();

        double nn = Math.floor(n / (a+b) * 1.0);

        long blue = ((long)nn) * a;
        long red = ((long)nn) * b;

        if (blue + red + a <= n) blue += a;
        else blue += (n - (blue + red));

        System.out.println(blue);

    } main {
        Scanner sc = new Scanner(System.in);

        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();

        double nn = Math.floor(n / (a+b) * 1.0);

        long blue = ((long)nn) * a;
        long red = ((long)nn) * b;

        if (blue + red + a <= n) blue += a;
        else blue += (n - (blue + red));

        System.out.println(blue);

    } 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 double nn = Math.floor(n / (a+b) * 1.0); nn Math.floor(n / (a+b) * 1.0) Math.floor Math n / (a+b) * 1.0 n / (a+b) n (a+b) a b 1.0 long blue = ((long)nn) * a; blue ((long)nn) * a ((long)nn) a long red = ((long)nn) * b; red ((long)nn) * b ((long)nn) b if (blue + red + a <= n) blue += a;
        else blue += (n - (blue + red)); blue + red + a <= n blue + red + a blue + red + a blue red a n blue += a blue a blue += (n - (blue + red)) blue (n - (blue + red)) n (blue + red) blue red System.out.println(blue) System.out.println System.out System System.out blue String[] args args public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();

        double nn = Math.floor(n / (a+b) * 1.0);

        long blue = ((long)nn) * a;
        long red = ((long)nn) * b;

        if (blue + red + a <= n) blue += a;
        else blue += (n - (blue + red));

        System.out.println(blue);

    }
} public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();

        double nn = Math.floor(n / (a+b) * 1.0);

        long blue = ((long)nn) * a;
        long red = ((long)nn) * b;

        if (blue + red + a <= n) blue += a;
        else blue += (n - (blue + red));

        System.out.println(blue);

    }
} Main

import java.util.*;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();

        double nn = Math.floor(n / (a+b) * 1.0);

        long blue = ((long)nn) * a;
        long red = ((long)nn) * b;

        if (blue + red + a <= n) blue += a;
        else blue += (n - (blue + red));

        System.out.println(blue);

    }
}