#include <bits/stdc++.h>
using namespace std;
long long sq(long long x) { return x * x; }
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long n, c1, c2;
  cin >> n >> c1 >> c2;
  string str;
  cin >> str;
  int cnt1 = 0, cnt2 = 0;
  for (auto x : str)
    if (x == '0')
      ++cnt1;
    else
      ++cnt2;
  long long ans = 1e18;
  for (int i = 1; i <= cnt2; ++i) {
    long long temp =
        (n % i) * c2 * sq(n / i) + (i - n % i) * c2 * sq(n / i - 1) + c1 * i;
    ans = min(ans, temp);
  }
  cout << ans << endl;
  return 0;
}
