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 res = N / (A + B) * A;
        long m = N % (A + B);
        if(m>=A) res+=A;
        else res+=m;
        System.out.println(res);
    }
} 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 res = N / (A + B) * A;
        long m = N % (A + B);
        if(m>=A) res+=A;
        else res+=m;
        System.out.println(res);
    }
} 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 res = N / (A + B) * A;
        long m = N % (A + B);
        if(m>=A) res+=A;
        else res+=m;
        System.out.println(res);
    } main {
        Scanner scanner = new Scanner(System.in);
        long N = scanner.nextLong();
        long A = scanner.nextLong();
        long B = scanner.nextLong();
        long res = N / (A + B) * A;
        long m = N % (A + B);
        if(m>=A) res+=A;
        else res+=m;
        System.out.println(res);
    } 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 res = N / (A + B) * A; res N / (A + B) * A N / (A + B) N (A + B) A B A long m = N % (A + B); m N % (A + B) N (A + B) A B if(m>=A) res+=A;
        else res+=m; m>=A m A res+=A res A res+=m res m System.out.println(res) System.out.println System.out System System.out res 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 res = N / (A + B) * A;
        long m = N % (A + B);
        if(m>=A) res+=A;
        else res+=m;
        System.out.println(res);
    }
} 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 res = N / (A + B) * A;
        long m = N % (A + B);
        if(m>=A) res+=A;
        else res+=m;
        System.out.println(res);
    }
} 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 res = N / (A + B) * A;
        long m = N % (A + B);
        if(m>=A) res+=A;
        else res+=m;
        System.out.println(res);
    }
}