#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll long long int
#define pb push_back
#define fi first
#define se second
#define ld long double
#define pii pair<int,int>
#define vll vector<vector<ll> >
#define vi vector<int>(n)
#define vl vector<ll>
#define deb(x) cout<<x<<"\n";
#define disp(x) cout<<x.first<<" "<<x.second<<"\n";
using namespace std;
using namespace __gnu_pbds;
typedef tree<int,null_type,less<int>,rb_tree_tag, tree_order_statistics_node_update> indexed_set;
const int MOD=1000000007;
const int MOD2=998244353;
const ll MAX=9187201950435737471;
const int N=100005;
const int M=100005;
const int INF=2;
const double EPS=1e-9;
const long double PI=acos(-1);
#define endl '/n'
struct stableSum {
int cnt=0;
vector<double>v,pref{0};
void operator+=(double a){
assert(a>=0);
int s=++cnt;
while(s%2==0){
a+=v.back();
v.pop_back(),pref.pop_back();
s/=2;
}
v.push_back(a);
pref.push_back(pref.back() + a);
}
double val() {return pref.back();}
};
int cmp(int a,int b){
return a>b;
}
ll po(ll x,ll y){
x%=MOD;
ll ret=1;
while(y>0){
if(y&1){
ret=(ret*x)%MOD;
}
y=y>>1ll;
x=(x*x)%MOD;
}
return ret%MOD;
}
string tostring(ll x){
string ret="";
while(x){
ret+=char(x%10+'0');
x/=10;
}
reverse(ret.begin(),ret.end());
return ret;
}
void solve(int T){
ll n,x,y;
cin>>n>>x>>y;
if(x>y)swap(x,y);
ll st=0,en=n,ret=n*x;
while(st<=en){
ll md1=st+(en-st)/3;
ll md2=en-(en-st)/3;
if(max(md1*x,(n-md1)*y)<max(md2*x,(n-md2)*y)){
ret=md1;
en=md2-1;
}
else {
ret=md2;
st=md1+1;
}
}
cout<<max(ret*x,(n-ret)*y);
}
int main(){
//freopen("test_input.txt","r",stdin);
//freopen("output.txt","w",stdout);
fastio
int T=1;
//cin>>T;
for(int i=1;i<=T;i++){
solve(i);
//if(i<T)cout<<"\n";
}
return 0;
}
/*
*/
Copy