#include <bits/stdc++.h>
using namespace std;
int n, c1, c2, tot = 1, stk[20];
long long ans;
map<long long, int> m;
priority_queue<long long, vector<long long>, greater<long long> > hp;
int main() {
  scanf("%d%d%d", &n, &c1, &c2);
  if (!c1 && !c2) {
    puts("0");
    return 0;
  }
  if (!c1 || !c2) {
    printf("%lld\n", (1LL * (n - 1) * max(c1, c2)));
    return 0;
  }
  hp.push(0);
  m[0] = 1;
  while (tot < n) {
    long long x = hp.top();
    hp.pop();
    int u = min(m[x], n - tot);
    m[x] -= u;
    tot += u;
    ans += 1LL * u * (c1 + c2) + x * u;
    if (!m[x + c1])
      m[x + c1] = u, hp.push(x + c1);
    else
      m[x + c1] += u;
    if (!m[x + c2])
      m[x + c2] = u, hp.push(x + c2);
    else
      m[x + c2] += u;
  }
  printf("%lld\n", ans);
  return 0;
}
