#include <bits/stdc++.h>
using namespace std;
map<long long, long long> M;
int main() {
  ios_base::sync_with_stdio(0);
  long long n, a, b;
  cin >> n >> a >> b;
  if (min(a, b) == 0) {
    long long res = max(a, b) * (n - 1);
    cout << res << "\n";
    return 0;
  }
  M[0] = 1;
  n--;
  while (n > 0) {
    auto x = *M.begin();
    if (x.second <= n) {
      n -= x.second;
      M.erase(M.begin());
      M[x.first + a] += x.second;
      M[x.first + b] += x.second;
    } else {
      M[x.first] -= n;
      M[x.first + a] += n;
      M[x.first + b] += n;
      n = 0;
    }
  }
  long long ans = 0;
  for (auto x : M) ans += x.second * x.first;
  cout << ans << "\n";
  return 0;
}
