#include <bits/stdc++.h>
char s[200005];
long long cnt, n, c1, c2, ans;
long long f(long long x) { return c2 * x * x; }
int main() {
  scanf("%lld%lld%lld", &n, &c1, &c2);
  scanf("%s", s + 1);
  for (int i = 1; i <= n; i++)
    if (s[i] == '1') cnt++;
  ans = 1e18;
  for (long long i = 1; i <= cnt; i++) {
    long long tmp = n % i, o = n / i, res = 0;
    res = i * c1 + tmp * f(o) + (i - tmp) * f(o - 1);
    if (ans > res) ans = res;
  }
  printf("%lld\n", ans);
}
