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