#include <cstdio>
#include <cassert>
#include <algorithm>

using namespace std;

int main() {
  assert(freopen("apricot.in", "r", stdin));
  assert(freopen("apricot.out", "w", stdout));

  int _n, a, b, ans;
  assert(scanf("%d%d%d", &_n, &a, &b));
  for (int n = 1; n <= _n; n++) {
    int l = 0, t = n - 1;
    while (t > 0) {
      t /= 3;
      l++;
    }
    ans = 0;
    if (l > 0) {
      ans = max(a, b) + min(a, b) * max(0, (l - 1));
    } else {
      ans = 0;
    }
  }
  printf("%d\n", ans);

  return 0;
}
