import java.util.*;

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();

        long ab = a+b;
        long tmp = n/ab;
        long tmp2 = n-ab*tmp;

        if (tmp2 >= a) System.out.println(a*tmp+a);
        else System.out.println(a*tmp+tmp2);
    }
} import java.util.*; util.* java 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();

        long ab = a+b;
        long tmp = n/ab;
        long tmp2 = n-ab*tmp;

        if (tmp2 >= a) System.out.println(a*tmp+a);
        else System.out.println(a*tmp+tmp2);
    }
} 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();

        long ab = a+b;
        long tmp = n/ab;
        long tmp2 = n-ab*tmp;

        if (tmp2 >= a) System.out.println(a*tmp+a);
        else System.out.println(a*tmp+tmp2);
    } main {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();

        long ab = a+b;
        long tmp = n/ab;
        long tmp2 = n-ab*tmp;

        if (tmp2 >= a) System.out.println(a*tmp+a);
        else System.out.println(a*tmp+tmp2);
    } 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 ab = a+b; ab a+b a b long tmp = n/ab; tmp n/ab n ab long tmp2 = n-ab*tmp; tmp2 n-ab*tmp n ab*tmp ab tmp if (tmp2 >= a) System.out.println(a*tmp+a);
        else System.out.println(a*tmp+tmp2); tmp2 >= a tmp2 a System.out.println(a*tmp+a) System.out.println System.out System System.out a*tmp+a a*tmp a tmp a System.out.println(a*tmp+tmp2) System.out.println System.out System System.out a*tmp+tmp2 a*tmp a tmp tmp2 String[] args args
import java.util.*;

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();

        long ab = a+b;
        long tmp = n/ab;
        long tmp2 = n-ab*tmp;

        if (tmp2 >= a) System.out.println(a*tmp+a);
        else System.out.println(a*tmp+tmp2);
    }
}