#include <bits/stdc++.h>
using namespace std;
bool debug = 0;
int n, m, k;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
string direc = "RDLU";
long long ln, lk, lm;
void etp(bool f = 0) {
  puts(f ? "YES" : "NO");
  exit(0);
}
void addmod(int &x, int y, int mod = 1000000007) {
  x += y;
  if (x >= mod) x -= mod;
  assert(x >= 0 && x < mod);
}
void et() {
  puts("-1");
  exit(0);
}
int c1, c2, as;
char s[200105];
void fmain(int tid) {
  scanf("%d%d%d", &n, &c1, &c2);
  scanf("%s", s);
  for (int(i) = 0; (i) < (int)(n); (i)++)
    if (s[i] == '1') as++;
  long long Ans = (1LL << 60);
  for (int(i) = 1; (i) <= (int)(as); (i)++) {
    long long ans = (long long)c1 * i;
    int tar = n / i;
    int rm = n - tar * i;
    long long p2 =
        (long long)(i - rm) * tar * tar + (long long)rm * (tar + 1) * (tar + 1);
    ans += (p2 + i - 2 * n) * c2;
    Ans = min(Ans, ans);
  }
  printf("%lld\n", Ans);
}
int main() {
  int t = 1;
  for (int(i) = 1; (i) <= (int)(t); (i)++) {
    fmain(i);
  }
  return 0;
}
