import javax.sound.midi.Soundbank;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Long N, A, B;
        Scanner sc = new Scanner(System.in);
        N = sc.nextLong();
        A = sc.nextLong();
        B = sc.nextLong();
        Long N2 = N%(A+B);
        Long N1 = N/(A+B);
        System.out.println(A*N1 + (N2 >= A ? A : N2) );
    }
} import javax.sound.midi.Soundbank; Soundbank javax.sound.midi import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Long N, A, B;
        Scanner sc = new Scanner(System.in);
        N = sc.nextLong();
        A = sc.nextLong();
        B = sc.nextLong();
        Long N2 = N%(A+B);
        Long N1 = N/(A+B);
        System.out.println(A*N1 + (N2 >= A ? A : N2) );
    }
} Main public static void main(String[] args) {
        Long N, A, B;
        Scanner sc = new Scanner(System.in);
        N = sc.nextLong();
        A = sc.nextLong();
        B = sc.nextLong();
        Long N2 = N%(A+B);
        Long N1 = N/(A+B);
        System.out.println(A*N1 + (N2 >= A ? A : N2) );
    } main {
        Long N, A, B;
        Scanner sc = new Scanner(System.in);
        N = sc.nextLong();
        A = sc.nextLong();
        B = sc.nextLong();
        Long N2 = N%(A+B);
        Long N1 = N/(A+B);
        System.out.println(A*N1 + (N2 >= A ? A : N2) );
    } Long N N A A B; B Scanner sc = new Scanner(System.in); sc new Scanner(System.in) N = sc.nextLong() N sc.nextLong() sc.nextLong sc A = sc.nextLong() A sc.nextLong() sc.nextLong sc B = sc.nextLong() B sc.nextLong() sc.nextLong sc Long N2 = N%(A+B); N2 N%(A+B) N (A+B) A B Long N1 = N/(A+B); N1 N/(A+B) N (A+B) A B System.out.println(A*N1 + (N2 >= A ? A : N2) ) System.out.println System.out System System.out A*N1 + (N2 >= A ? A : N2) A*N1 A N1 (N2 >= A ? A : N2) N2 >= A N2 A A N2 String[] args args public class Main {
    public static void main(String[] args) {
        Long N, A, B;
        Scanner sc = new Scanner(System.in);
        N = sc.nextLong();
        A = sc.nextLong();
        B = sc.nextLong();
        Long N2 = N%(A+B);
        Long N1 = N/(A+B);
        System.out.println(A*N1 + (N2 >= A ? A : N2) );
    }
} public class Main {
    public static void main(String[] args) {
        Long N, A, B;
        Scanner sc = new Scanner(System.in);
        N = sc.nextLong();
        A = sc.nextLong();
        B = sc.nextLong();
        Long N2 = N%(A+B);
        Long N1 = N/(A+B);
        System.out.println(A*N1 + (N2 >= A ? A : N2) );
    }
} Main
import javax.sound.midi.Soundbank;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Long N, A, B;
        Scanner sc = new Scanner(System.in);
        N = sc.nextLong();
        A = sc.nextLong();
        B = sc.nextLong();
        Long N2 = N%(A+B);
        Long N1 = N/(A+B);
        System.out.println(A*N1 + (N2 >= A ? A : N2) );
    }
}
