/* صل علي محمد ﷺ*/


#include                   <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
#include                   <unordered_map>
#include                   <unordered_set>
#define IOS                ios_base::sync_with_stdio(0);\
                           cin.tie(NULL);cout.tie(NULL); 
#define OO                 0x3f3f3f3f
#define endd               "\n"
#define sett               cout<< fixed << showpoint\
                           << setprecision
#define ff                 first
#define ss                 second
#define sz(s)              ((int)(s).size())
#define all(v)             (v).begin(),(v).end()
#define rall(v)            (v).rbegin(),(v).rend()
#define File ofstream      coutt("outt.txt");\
                           ifstream cinn("inn.txt");
#define ordered_set        tree<int, null_type,\
                           less_equal<int>, rb_tree_tag,\
                           tree_order_statistics_node_update>
#define pii                pair<int,int>
typedef long long          ll;
typedef double             dd;
int dy[] = { -1, 1, 0, 0, -1, 1, 1, -1 };
int dx[] = { 0, 0, 1, -1, 1, -1, 1, -1 };
/// priority_queue<ll, vector<ll>, greater<ll>>q;
using namespace std;

/* صل علي محمد ﷺ*/

vector<int> KMP(string& s) {
	int n = s.size();
	vector<int> fail(n);
	for (int i = 1; i < n; i++) {
		int j = fail[i - 1];
		while (j > 0 and s[j] != s[i])
			j = fail[j - 1];

		j += s[i] == s[j];
		fail[i] = j;
	}
	return fail;
}

void solve() {

	ll n, x, y, z;
	cin >> n >> x >> y >> z;
	string s; cin >> s;

	vector<int>pre = KMP(s);
	//for (int i = 0; i < n; i++)cout << pre[i]; cout << '\n';
	reverse(all(s));
	vector<int>suf = KMP(s);
	reverse(all(suf));
	int l = 1, r = n - 2;
	ll ans = 0;

	//for (int i = 0; i < n; ++i)cout << i; cout << '\n';

	while (l < r) {

		if (!pre[l])l++;
		if (!suf[r])r--;
		if (!pre[l] || !suf[r])continue;
		if (l >= r)continue;

		ll calc = pre[l] * x + suf[r] * y - z + (r - l) * z;
		//cout << l << ' ' << r <<' '<< calc << '\n';
		//cout << pre[l] << ' ' << suf[r] << '\n';
		ans = max(ans, calc);
		if (x >= z)	l++;
		if (y >= z) r--;

		if (z >= x and z >= y)break;

	}
	cout << ans;

}


int main() {
	//freopen("Input.in", "r", stdin);
	//freopen("Output.txt", "w", stdout);
	IOS;
	//cout << mx;
	int test_cases = 1;
	//cin >> test_cases;
	for (int i = 1; i <= test_cases; i++) {
		solve();
		//cout << endd;
	}
}