import java.util.*;
import java.lang.*;
import java.io.*;

public 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 so=n/(a+b);
        if(a==0){
            System.out.println('0');
            System.exit(0);
        }else if(n%(a+b)<=a){
            System.out.println(a*so + n%(a+b));
            System.exit(0);
        }else{
            System.out.print(a*so+a);
        }
    }
} import java.util.*; util.* java import java.lang.*; lang.* java import java.io.*; io.* java public 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 so=n/(a+b);
        if(a==0){
            System.out.println('0');
            System.exit(0);
        }else if(n%(a+b)<=a){
            System.out.println(a*so + n%(a+b));
            System.exit(0);
        }else{
            System.out.print(a*so+a);
        }
    }
} 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 so=n/(a+b);
        if(a==0){
            System.out.println('0');
            System.exit(0);
        }else if(n%(a+b)<=a){
            System.out.println(a*so + n%(a+b));
            System.exit(0);
        }else{
            System.out.print(a*so+a);
        }
    } main {
        Scanner sc = new Scanner(System.in);
    long  n=sc.nextLong();
        long a=sc.nextLong();
        long b=sc.nextLong();

        long so=n/(a+b);
        if(a==0){
            System.out.println('0');
            System.exit(0);
        }else if(n%(a+b)<=a){
            System.out.println(a*so + n%(a+b));
            System.exit(0);
        }else{
            System.out.print(a*so+a);
        }
    } 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 so=n/(a+b); so n/(a+b) n (a+b) a b if(a==0){
            System.out.println('0');
            System.exit(0);
        }else if(n%(a+b)<=a){
            System.out.println(a*so + n%(a+b));
            System.exit(0);
        }else{
            System.out.print(a*so+a);
        } a==0 a 0 {
            System.out.println('0');
            System.exit(0);
        } System.out.println('0') System.out.println System.out System System.out '0' System.exit(0) System.exit System 0 if(n%(a+b)<=a){
            System.out.println(a*so + n%(a+b));
            System.exit(0);
        }else{
            System.out.print(a*so+a);
        } n%(a+b)<=a n%(a+b) n (a+b) a b a {
            System.out.println(a*so + n%(a+b));
            System.exit(0);
        } System.out.println(a*so + n%(a+b)) System.out.println System.out System System.out a*so + n%(a+b) a*so a so n%(a+b) n (a+b) a b System.exit(0) System.exit System 0 {
            System.out.print(a*so+a);
        } System.out.print(a*so+a) System.out.print System.out System System.out a*so+a a*so a so a String[] args args public 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 so=n/(a+b);
        if(a==0){
            System.out.println('0');
            System.exit(0);
        }else if(n%(a+b)<=a){
            System.out.println(a*so + n%(a+b));
            System.exit(0);
        }else{
            System.out.print(a*so+a);
        }
    }
} public 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 so=n/(a+b);
        if(a==0){
            System.out.println('0');
            System.exit(0);
        }else if(n%(a+b)<=a){
            System.out.println(a*so + n%(a+b));
            System.exit(0);
        }else{
            System.out.print(a*so+a);
        }
    }
} Main
import java.util.*;
import java.lang.*;
import java.io.*;

public 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 so=n/(a+b);
        if(a==0){
            System.out.println('0');
            System.exit(0);
        }else if(n%(a+b)<=a){
            System.out.println(a*so + n%(a+b));
            System.exit(0);
        }else{
            System.out.print(a*so+a);
        }
    }
}