#include <bits/stdc++.h>
using namespace std;
const int maxn = 200000 + 10;
const long long INF = 1ll * 0x3fffffff * 0x3fffffff;
long long n, m, c1, c2;
char s[maxn];
void read() {
  int i;
  scanf("%d%I64d%I64d%s", &n, &c1, &c2, s);
  for (i = 0, m = 0; i < n; i++) m += s[i] - '0';
}
void solve() {
  long long i, ans = INF;
  for (i = 1; i <= m; i++) {
    ans = min(ans, (n % i) * (c2 * (n / i) * (n / i)) +
                       (i - n % i) * (c2 * (n / i - 1) * (n / i - 1)) + c1 * i);
  }
  cout << ans;
}
int main() {
  read();
  solve();
  return 0;
}
