#include <bits/stdc++.h>
using namespace std;
string itos(int x) {
  stringstream ss;
  ss << x;
  return ss.str();
}
string str;
long long a, b, n, m;
long long f(long long x) {
  long long k1 = (a + b) / x - 1;
  long long k2 = (k1 + 1);
  long long cnt2 = (a + b) % x;
  long long cnt1 = x - cnt2;
  return x * n + m * (cnt1 * (k1 * k1) + cnt2 * (k2 * k2));
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> b >> n >> m >> str;
  a = count_if(str.begin(), str.end(), [](char x) { return x == '1'; });
  b -= a;
  {
    long long l, r;
    l = 1, r = a;
    while (l != r) {
      if (l + 1 == r) {
        l = (f(l) < f(r) ? l : r);
        break;
      }
      if (l + 2 == r) {
        long long mid = (l + r) / 2;
        if (f(l) < f(mid) && f(l) < f(r))
          break;
        else if (f(mid) < f(r))
          l = mid;
        else
          l = r;
        break;
      }
      long long dx = (r - l) / 3;
      long long x1 = l + dx, x2 = r - dx;
      if (f(x1) < f(x2))
        r = x2;
      else
        l = x1;
    }
    cout << f(l) << endl;
  }
  return 0;
}
