import java.util.*;
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 blue=N/(A+B);
		long mod=N%(A+B);
      if(mod>=A){
      mod=A;
	}
      System.out.println(blue*A+mod);
      
    }
} import java.util.*; util.* 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 blue=N/(A+B);
		long mod=N%(A+B);
      if(mod>=A){
      mod=A;
	}
      System.out.println(blue*A+mod);
      
    }
} 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 blue=N/(A+B);
		long mod=N%(A+B);
      if(mod>=A){
      mod=A;
	}
      System.out.println(blue*A+mod);
      
    } main {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		long N = sc.nextLong();
      	long A = sc.nextLong();
      	long B = sc.nextLong();
      	
      	long blue=N/(A+B);
		long mod=N%(A+B);
      if(mod>=A){
      mod=A;
	}
      System.out.println(blue*A+mod);
      
    } 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 blue=N/(A+B); blue N/(A+B) N (A+B) A B long mod=N%(A+B); mod N%(A+B) N (A+B) A B if(mod>=A){
      mod=A;
	} mod>=A mod A {
      mod=A;
	} mod=A mod A System.out.println(blue*A+mod) System.out.println System.out System System.out blue*A+mod blue*A blue A mod 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 blue=N/(A+B);
		long mod=N%(A+B);
      if(mod>=A){
      mod=A;
	}
      System.out.println(blue*A+mod);
      
    }
} 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 blue=N/(A+B);
		long mod=N%(A+B);
      if(mod>=A){
      mod=A;
	}
      System.out.println(blue*A+mod);
      
    }
} Main
import java.util.*;
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 blue=N/(A+B);
		long mod=N%(A+B);
      if(mod>=A){
      mod=A;
	}
      System.out.println(blue*A+mod);
      
    }
}
