#include<iostream>
#include<stack>
#include<cstdio>
#include<map>
#include<set>
#include<queue>
#include<cstring>
#include<cmath>
#include<vector>
#include<algorithm>
using namespace std;
typedef long long ll;
#define me(a,b) memset(a,b,sizeof(a))
#define inf 0x3f3f3f3f
const int N=1111122;
const int M=200005;
int main()
{
	ll n,i,j,a,b,sum=0,q;
	cin>>n>>a>>b;
	if(a==0)cout<<0<<endl;
	else if(n<=a)cout<<n<<endl;
	else 
	{
		q=n/(a+b);
		sum+=q*a;
		ll p=n%(a+b);
		if(p>=a)sum+=a;
		else sum+=p;
		cout<<sum<<endl;
	}
	return 0;
}
