#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using db = double;
const ll MXL = 0x3f3f3f3f3f3f3f3fLL;
ll lim = 100000;
ll n;
ll a, b;
vector<pair<ll, ll>> p;
multiset<ll> s;
void ini() {
  p = {{0, 0}};
  s = {0};
  for (int i = 0; i < lim || p.back().first - b == *s.begin(); ++i) {
    ll t = *s.begin();
    s.erase(s.begin());
    p.push_back({t + b, -t + (t + a) + (t + b)});
    s.insert(t + a);
    s.insert(t + b);
  }
  ll pre = 0;
  for (auto &i : p) i.second = pre += i.second;
}
ll count(ll deep) {
  if (deep <= p.back().first)
    return upper_bound(p.begin(), p.end(), make_pair(deep, LLONG_MAX)) -
           p.begin();
  ll re = 0;
  for (auto i : s)
    if (i <= deep) {
      re += upper_bound(p.begin(), p.end(), make_pair(deep - i, LLONG_MAX)) -
            p.begin();
      re = min(re, MXL);
    }
  return re;
}
ll sum(ll deep) {
  if (deep <= p.back().first)
    return prev(upper_bound(p.begin(), p.end(), make_pair(deep, LLONG_MAX)))
        ->second;
  ll re = 0;
  for (auto i : s)
    if (i <= deep) {
      auto t =
          prev(upper_bound(p.begin(), p.end(), make_pair(deep - i, LLONG_MAX)));
      re += t->second + ll(t - p.begin() + 1) * i;
      assert(re < MXL);
    }
  return re;
}
ll getDeep() {
  ll L = 0, R = MXL, M;
  while (L < R)
    if (M = L + R >> 1, count(M) >= n)
      R = M;
    else
      L = M + 1;
  return L;
}
int main() {
  cin >> n >> a >> b;
  if (a > b) swap(a, b);
  if (a == 0 && b == 0) {
    cout << 0 << endl;
    return 0;
  }
  if (a == 0) {
    cout << (n - 1) * b << endl;
    return 0;
  }
  ini();
  ll h = getDeep();
  ll c = count(h);
  ll ans = sum(h);
  if (c > n) ans -= (c - n) * (h + (h - b + a) - (h - b));
  cout << ans << endl;
  return 0;
}
