
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        // 数値の入力
        long a = sc.nextLong();
        long b = sc.nextLong();
        long c = sc.nextLong();

        boolean flg = false;
        // 固まり
        long l = b + c;

        // ブロック数とtarget
        long answer = b * (a / l);
        // 閾値
        long n = a % l;

        System.out.println(answer + Math.min(n, b));
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        // 数値の入力
        long a = sc.nextLong();
        long b = sc.nextLong();
        long c = sc.nextLong();

        boolean flg = false;
        // 固まり
        long l = b + c;

        // ブロック数とtarget
        long answer = b * (a / l);
        // 閾値
        long n = a % l;

        System.out.println(answer + Math.min(n, b));
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        // 数値の入力
        long a = sc.nextLong();
        long b = sc.nextLong();
        long c = sc.nextLong();

        boolean flg = false;
        // 固まり
        long l = b + c;

        // ブロック数とtarget
        long answer = b * (a / l);
        // 閾値
        long n = a % l;

        System.out.println(answer + Math.min(n, b));
    } main {
        Scanner sc = new Scanner(System.in);
        // 数値の入力
        long a = sc.nextLong();
        long b = sc.nextLong();
        long c = sc.nextLong();

        boolean flg = false;
        // 固まり
        long l = b + c;

        // ブロック数とtarget
        long answer = b * (a / l);
        // 閾値
        long n = a % l;

        System.out.println(answer + Math.min(n, b));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long a = sc.nextLong(); a sc.nextLong() sc.nextLong sc long b = sc.nextLong(); b sc.nextLong() sc.nextLong sc long c = sc.nextLong(); c sc.nextLong() sc.nextLong sc boolean flg = false; flg false long l = b + c; l b + c b c long answer = b * (a / l); answer b * (a / l) b (a / l) a l long n = a % l; n a % l a l System.out.println(answer + Math.min(n, b)) System.out.println System.out System System.out answer + Math.min(n, b) answer Math.min(n, b) Math.min Math n b String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        // 数値の入力
        long a = sc.nextLong();
        long b = sc.nextLong();
        long c = sc.nextLong();

        boolean flg = false;
        // 固まり
        long l = b + c;

        // ブロック数とtarget
        long answer = b * (a / l);
        // 閾値
        long n = a % l;

        System.out.println(answer + Math.min(n, b));
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        // 数値の入力
        long a = sc.nextLong();
        long b = sc.nextLong();
        long c = sc.nextLong();

        boolean flg = false;
        // 固まり
        long l = b + c;

        // ブロック数とtarget
        long answer = b * (a / l);
        // 閾値
        long n = a % l;

        System.out.println(answer + Math.min(n, b));
    }
} Main

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        // 数値の入力
        long a = sc.nextLong();
        long b = sc.nextLong();
        long c = sc.nextLong();

        boolean flg = false;
        // 固まり
        long l = b + c;

        // ブロック数とtarget
        long answer = b * (a / l);
        // 閾値
        long n = a % l;

        System.out.println(answer + Math.min(n, b));
    }
}
