#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 10;
const long long INF = (long long)1e18;
long long n, c1, c2, adu, ans;
char s[MAXN];
int main() {
  scanf("%I64d%I64d%I64d", &n, &c1, &c2);
  scanf("%s", s);
  for (long long i = 0; i < strlen(s); ++i)
    if (s[i] == '1') ++adu;
  ans = INF;
  for (long long i = 1; i <= adu; ++i) {
    long long k = n / i, lef = n % i;
    long long tmp = lef * (c1 + c2 * k * k);
    tmp += (i - lef) * (c1 + c2 * (k - 1) * (k - 1));
    ans = min(tmp, ans);
  }
  printf("%I64d\n", ans);
  return 0;
}
