import java.util.Scanner;

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();
      sc.close();

      if (a==0 && b==0) {
    	  System.out.println(0);
    	  return;
      }

      long answer = n/(a+b)*a;
      if (n%(a+b) <a) {
    	  answer+=n%(a+b);
      } else {
    	  answer+=a;
      }
      System.out.println(answer);
  	}
} import java.util.Scanner; Scanner 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();
      sc.close();

      if (a==0 && b==0) {
    	  System.out.println(0);
    	  return;
      }

      long answer = n/(a+b)*a;
      if (n%(a+b) <a) {
    	  answer+=n%(a+b);
      } else {
    	  answer+=a;
      }
      System.out.println(answer);
  	}
} 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();
      sc.close();

      if (a==0 && b==0) {
    	  System.out.println(0);
    	  return;
      }

      long answer = n/(a+b)*a;
      if (n%(a+b) <a) {
    	  answer+=n%(a+b);
      } else {
    	  answer+=a;
      }
      System.out.println(answer);
  	} main {
      //入力値の取得
      Scanner sc = new Scanner(System.in);
      long n = sc.nextLong();
      long a = sc.nextLong();
      long b = sc.nextLong();
      sc.close();

      if (a==0 && b==0) {
    	  System.out.println(0);
    	  return;
      }

      long answer = n/(a+b)*a;
      if (n%(a+b) <a) {
    	  answer+=n%(a+b);
      } else {
    	  answer+=a;
      }
      System.out.println(answer);
  	} 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 sc.close() sc.close sc if (a==0 && b==0) {
    	  System.out.println(0);
    	  return;
      } a==0 && b==0 a==0 a 0 b==0 b 0 {
    	  System.out.println(0);
    	  return;
      } System.out.println(0) System.out.println System.out System System.out 0 return; long answer = n/(a+b)*a; answer n/(a+b)*a n/(a+b) n (a+b) a b a if (n%(a+b) <a) {
    	  answer+=n%(a+b);
      } else {
    	  answer+=a;
      } n%(a+b) <a n%(a+b) n (a+b) a b a {
    	  answer+=n%(a+b);
      } answer+=n%(a+b) answer n%(a+b) n (a+b) a b {
    	  answer+=a;
      } answer+=a answer a System.out.println(answer) System.out.println System.out System System.out answer 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();
      sc.close();

      if (a==0 && b==0) {
    	  System.out.println(0);
    	  return;
      }

      long answer = n/(a+b)*a;
      if (n%(a+b) <a) {
    	  answer+=n%(a+b);
      } else {
    	  answer+=a;
      }
      System.out.println(answer);
  	}
} 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();
      sc.close();

      if (a==0 && b==0) {
    	  System.out.println(0);
    	  return;
      }

      long answer = n/(a+b)*a;
      if (n%(a+b) <a) {
    	  answer+=n%(a+b);
      } else {
    	  answer+=a;
      }
      System.out.println(answer);
  	}
} Main
import java.util.Scanner;

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();
      sc.close();

      if (a==0 && b==0) {
    	  System.out.println(0);
    	  return;
      }

      long answer = n/(a+b)*a;
      if (n%(a+b) <a) {
    	  answer+=n%(a+b);
      } else {
    	  answer+=a;
      }
      System.out.println(answer);
  	}
}