/*package whatever //do not write package name here */

import java.io.*;
import java.util.Scanner;



public class Main {
	public static void main (String[] args)throws IOException {
// 		System.out.println("GfG!");
// Scanner sc = new Scanner(System.in);
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String s[]= br.readLine().split(" ");

long  n= Long.parseLong(s[0]);
long a=Long.parseLong(s[1]);
long b= Long.parseLong(s[2]);
if(a==0 && b==0){
    System.out.println(0);
}
else{
long sum= a+b;
sum=n%sum;
if(sum>a)
sum=a;

long x= n/(a+b);

System.out.println(x*a+sum);
}
	}
} import java.io.*; io.* java import java.util.Scanner; Scanner java.util public class Main {
	public static void main (String[] args)throws IOException {
// 		System.out.println("GfG!");
// Scanner sc = new Scanner(System.in);
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String s[]= br.readLine().split(" ");

long  n= Long.parseLong(s[0]);
long a=Long.parseLong(s[1]);
long b= Long.parseLong(s[2]);
if(a==0 && b==0){
    System.out.println(0);
}
else{
long sum= a+b;
sum=n%sum;
if(sum>a)
sum=a;

long x= n/(a+b);

System.out.println(x*a+sum);
}
	}
} Main public static void main (String[] args)throws IOException {
// 		System.out.println("GfG!");
// Scanner sc = new Scanner(System.in);
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String s[]= br.readLine().split(" ");

long  n= Long.parseLong(s[0]);
long a=Long.parseLong(s[1]);
long b= Long.parseLong(s[2]);
if(a==0 && b==0){
    System.out.println(0);
}
else{
long sum= a+b;
sum=n%sum;
if(sum>a)
sum=a;

long x= n/(a+b);

System.out.println(x*a+sum);
}
	} main {
// 		System.out.println("GfG!");
// Scanner sc = new Scanner(System.in);
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String s[]= br.readLine().split(" ");

long  n= Long.parseLong(s[0]);
long a=Long.parseLong(s[1]);
long b= Long.parseLong(s[2]);
if(a==0 && b==0){
    System.out.println(0);
}
else{
long sum= a+b;
sum=n%sum;
if(sum>a)
sum=a;

long x= n/(a+b);

System.out.println(x*a+sum);
}
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String s[]= br.readLine().split(" "); s br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " long  n= Long.parseLong(s[0]); n Long.parseLong(s[0]) Long.parseLong Long s[0] s 0 long a=Long.parseLong(s[1]); a Long.parseLong(s[1]) Long.parseLong Long s[1] s 1 long b= Long.parseLong(s[2]); b Long.parseLong(s[2]) Long.parseLong Long s[2] s 2 if(a==0 && b==0){
    System.out.println(0);
}
else{
long sum= a+b;
sum=n%sum;
if(sum>a)
sum=a;

long x= n/(a+b);

System.out.println(x*a+sum);
} a==0 && b==0 a==0 a 0 b==0 b 0 {
    System.out.println(0);
} System.out.println(0) System.out.println System.out System System.out 0 {
long sum= a+b;
sum=n%sum;
if(sum>a)
sum=a;

long x= n/(a+b);

System.out.println(x*a+sum);
} long sum= a+b; sum a+b a b sum=n%sum sum n%sum n sum if(sum>a)
sum=a; sum>a sum a sum=a sum a long x= n/(a+b); x n/(a+b) n (a+b) a b System.out.println(x*a+sum) System.out.println System.out System System.out x*a+sum x*a x a sum String[] args args public class Main {
	public static void main (String[] args)throws IOException {
// 		System.out.println("GfG!");
// Scanner sc = new Scanner(System.in);
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String s[]= br.readLine().split(" ");

long  n= Long.parseLong(s[0]);
long a=Long.parseLong(s[1]);
long b= Long.parseLong(s[2]);
if(a==0 && b==0){
    System.out.println(0);
}
else{
long sum= a+b;
sum=n%sum;
if(sum>a)
sum=a;

long x= n/(a+b);

System.out.println(x*a+sum);
}
	}
} public class Main {
	public static void main (String[] args)throws IOException {
// 		System.out.println("GfG!");
// Scanner sc = new Scanner(System.in);
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String s[]= br.readLine().split(" ");

long  n= Long.parseLong(s[0]);
long a=Long.parseLong(s[1]);
long b= Long.parseLong(s[2]);
if(a==0 && b==0){
    System.out.println(0);
}
else{
long sum= a+b;
sum=n%sum;
if(sum>a)
sum=a;

long x= n/(a+b);

System.out.println(x*a+sum);
}
	}
} Main
/*package whatever //do not write package name here */

import java.io.*;
import java.util.Scanner;



public class Main {
	public static void main (String[] args)throws IOException {
// 		System.out.println("GfG!");
// Scanner sc = new Scanner(System.in);
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String s[]= br.readLine().split(" ");

long  n= Long.parseLong(s[0]);
long a=Long.parseLong(s[1]);
long b= Long.parseLong(s[2]);
if(a==0 && b==0){
    System.out.println(0);
}
else{
long sum= a+b;
sum=n%sum;
if(sum>a)
sum=a;

long x= n/(a+b);

System.out.println(x*a+sum);
}
	}
}