#include <bits/stdc++.h>
using namespace std;
long long c0, c1, n;
long long gcd(long long a, long long b) {
  if (b)
    return gcd(b, a % b);
  else
    return a;
}
long long lyslys[31];
long long cycyc(long long a, long long b) {
  long long s = 1, x, g, i;
  for (i = 1; i <= b; ++i) lyslys[i] = i;
  for (i = 0; i < b; ++i) {
    x = a + b - i;
    for (long long j = 1; j <= b; j++) {
      g = gcd(lyslys[j], x);
      x /= g;
      lyslys[j] /= g;
    }
    if (x > 1061109567 / s) return 1061109567;
    s *= x;
  }
  return s;
}
long long check(long long x) {
  long long tmp = x / c0 + x / c1 + 1;
  if (tmp > n) return 1;
  long long i, j;
  for (i = 1; i <= 26; ++i) {
    for (j = i; j * c0 + i * c1 <= x; ++j) {
      tmp += cycyc(j, i);
      if (tmp > n) return 1;
    }
    for (j = i + 1; j * c1 + i * c0 <= x; ++j) {
      tmp += cycyc(j, i);
      if (tmp > n) return 1;
    }
  }
  return 0;
}
void keywet(long long x, long long &tmp, long long &ans) {
  tmp = x / c0 + x / c1 + 1;
  ans = ((x / c0) * (x / c0 + 1) * c0 + (x / c1) * (x / c1 + 1) * c1) >> 1;
  long long c, i, j;
  for (i = 1; i <= 26; ++i) {
    for (j = i; j * c0 + i * c1 <= x; ++j) {
      c = cycyc(j, i);
      tmp += c;
      ans += c * (j * c0 + i * c1);
    }
    for (j = i + 1; j * c1 + i * c0 <= x; ++j) {
      c = cycyc(j, i);
      tmp += c;
      ans += c * (j * c1 + i * c0);
    }
  }
}
void skc() {
  int a, b, c, d, e;
  a = 1;
  b = 2;
  c = 3;
  d = 4;
  e = 5;
  b = a + c;
  a = ++ ++ ++ ++ ++ ++ ++ ++ ++c;
  d = ++ ++a;
  int dblark;
  int AK_IOI;
  dblark = AK_IOI = ++ ++c;
}
int main() {
  skc();
  scanf("%lld%lld%lld", &n, &c0, &c1);
  n--;
  if (c0 > c1) swap(c0, c1);
  if (!c0) {
    printf("%lld\n", n * c1);
    return 0;
  }
  long long l = 0, r = c1 * 26, mid;
  while (l <= r) {
    mid = (l + r) >> 1;
    if (check(mid))
      r = mid - 1;
    else
      l = mid + 1;
  }
  long long c, s;
  keywet(l - 1, c, s);
  s += (n - c) * l + n * (c0 + c1);
  printf("%lld\n", s);
  return 0;
}
