#include <bits/stdc++.h>
using namespace std;
bool home = 1;
signed realMain();
signed main() {
  home = 0;
  if (home) {
    freopen("tony_stark", "r", stdin);
  } else {
    ios::sync_with_stdio(0);
    cin.tie(0);
  }
  realMain();
}
map<long long, long long> cnt;
long long n, c0, c1, zuc;
signed realMain() {
  cin >> n >> c0 >> c1;
  zuc = 1;
  cnt[0]++;
  while (zuc < n) {
    auto it = cnt.begin();
    long long kolrabi = min(it->second, n - zuc);
    zuc += kolrabi;
    cnt[it->first + c0] += kolrabi;
    cnt[it->first + c1] += kolrabi;
    it->second -= kolrabi;
    if (!it->second) {
      cnt.erase(it);
    }
  }
  long long zuk = 0;
  for (auto &it : cnt) {
    long long taki = min(it.second, n);
    n -= taki;
    zuk += taki * it.first;
  }
  cout << zuk << "\n";
  return 0;
}
