#include <bits/stdc++.h>
#define st first
#define nd second

using namespace std;
using ull = long long;

void debug_out() { cerr << endl; }
template<class T> ostream& prnt(ostream& out, T v) { out << v.size() << '\n'; for(auto e : v) out << e << ' '; return out;}
template<class T> ostream& operator<<(ostream& out, vector <T> v) { return prnt(out, v); }
template<class T> ostream& operator<<(ostream& out, set <T> v) { return prnt(out, v); }
template<class T1, class T2> ostream& operator<<(ostream& out, map <T1, T2> v) { return prnt(out, v); }
template<class T1, class T2> ostream& operator<<(ostream& out, pair<T1, T2> p) { return out << '(' << p.st << ' ' << p.nd << ')'; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) { cerr << " " << H; debug_out(T...);}

#define dbg(...) cerr << #__VA_ARGS__ << " ->", debug_out(__VA_ARGS__)
#define dbg_v(x, n) do{cerr<<#x"[]: ";for(int _=0;_<n;++_)cerr<<x[_]<<" ";cerr<<'\n';}while(0)
#define dbg_ok cerr<<"OK!\n"

const int N = 5005;
const ull B = 31;
const int MOD = 1e9 + 7;
const int MODH = 2e6 + 67;
int n, a, b, dp[N];
ull hsh;
string s;

unordered_map <int, int> fst[N];

struct hasher {

	vector <pair<pair <int, int> , int >> v[MODH];

	void add(int hsh, int lg, int pos) {
		// dbg(hsh, lg, pos);
		if(get(hsh, lg) == -1)
			v[hsh % MODH].push_back({{hsh, lg}, pos});
	}

	int get(int hsh, int lg) {
		// dbg(hsh, lg);
		for(auto i : v[hsh % MODH])
			if(i.st == make_pair(hsh, lg))
				return i.nd;
		return -1;
	}
} hhh;

int main() {
	ios_base::sync_with_stdio(false);

	cin >> n >> a >> b;
	cin >> s;

	s = "#" + s;

	for(int i = 1; i <= n; i++) {
		dp[i] = dp[i - 1] + a;

		hsh = 0;
		for(int j = i; j >= 1; j--) {
			hsh = (hsh * B + s[j] - 'a' + 1) % MOD;

			int min_val = hhh.get(hsh, i - j + 1);

			if(min_val != -1) {
				if(min_val < j)
					dp[i] = min(dp[i], dp[j - 1] + b);
			} else
				hhh.add(hsh, i - j + 1, i);
		}
	}
	// dbg_v(dp, n+ 1);
	cout << dp[n] << '\n';
}


#include <bits/stdc++.h>
#define st first
#define nd second

using namespace std;
using ull = long long;

void debug_out() { cerr << endl; }
template<class T> ostream& prnt(ostream& out, T v) { out << v.size() << '\n'; for(auto e : v) out << e << ' '; return out;}
template<class T> ostream& operator<<(ostream& out, vector <T> v) { return prnt(out, v); }
template<class T> ostream& operator<<(ostream& out, set <T> v) { return prnt(out, v); }
template<class T1, class T2> ostream& operator<<(ostream& out, map <T1, T2> v) { return prnt(out, v); }
template<class T1, class T2> ostream& operator<<(ostream& out, pair<T1, T2> p) { return out << '(' << p.st << ' ' << p.nd << ')'; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) { cerr << " " << H; debug_out(T...);}

#define dbg(...) cerr << #__VA_ARGS__ << " ->", debug_out(__VA_ARGS__)
#define dbg_v(x, n) do{cerr<<#x"[]: ";for(int _=0;_<n;++_)cerr<<x[_]<<" ";cerr<<'\n';}while(0)
#define dbg_ok cerr<<"OK!\n"

const int N = 5005;
const ull B = 31;
const int MOD = 1e9 + 17;
const int MODH = 1e5 + 67013;
int n, a, b, dp[N];
ull hsh, hsh1;
string s;

struct hasher {

	vector <pair<pair <int, int> , int >> v[MODH];

	void add(int hsh1, int hsh, int lg, int pos) {
		if(get(hsh1, hsh, lg) == -1)
			v[hsh1].push_back({{hsh, lg}, pos});
	}

	int get(int hsh1, int hsh, int lg) {
		for(auto i : v[hsh1])
			if(i.st == make_pair(hsh, lg))
				return i.nd;
		return -1;
	}
} hhh;

int main() {
	ios_base::sync_with_stdio(false);

	cin >> n >> a >> b;
	cin >> s;

	s = "#" + s;

	for(int i = 1; i <= n; i++) {
		dp[i] = dp[i - 1] + a;

		hsh = 0;
		hsh1 = 0;
		for(int j = i; j >= 1; j--) {
			hsh = (hsh * B + s[j] - 'a' + 1) % MOD;
			hsh1 = (hsh1 * B + s[j] - 'a' + 1) % MODH;

			int min_val = hhh.get(hsh1, hsh, i - j + 1);

			if(min_val != -1) {
				if(min_val < j)
					dp[i] = min(dp[i], dp[j - 1] + b);
			} else
				hhh.add(hsh1, hsh, i - j + 1, i);
		}
	}
	// dbg_v(dp, n+ 1);
	cout << dp[n] << '\n';
}


#include <bits/stdc++.h>
#define st first
#define nd second

using namespace std;
using ull = long long;

void debug_out() { cerr << endl; }
template<class T> ostream& prnt(ostream& out, T v) { out << v.size() << '\n'; for(auto e : v) out << e << ' '; return out;}
template<class T> ostream& operator<<(ostream& out, vector <T> v) { return prnt(out, v); }
template<class T> ostream& operator<<(ostream& out, set <T> v) { return prnt(out, v); }
template<class T1, class T2> ostream& operator<<(ostream& out, map <T1, T2> v) { return prnt(out, v); }
template<class T1, class T2> ostream& operator<<(ostream& out, pair<T1, T2> p) { return out << '(' << p.st << ' ' << p.nd << ')'; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) { cerr << " " << H; debug_out(T...);}

#define dbg(...) cerr << #__VA_ARGS__ << " ->", debug_out(__VA_ARGS__)
#define dbg_v(x, n) do{cerr<<#x"[]: ";for(int _=0;_<n;++_)cerr<<x[_]<<" ";cerr<<'\n';}while(0)
#define dbg_ok cerr<<"OK!\n"

const int N = 5005;
const ull B = 31;
const int MOD = 1e9 + 7;
const int MODH = 2e6 + 67013;
int n, a, b, dp[N];
ull hsh, hsh1;
string s;

struct hasher {

	vector <pair <int, int> > v[MODH];

	void add(int hsh1, int hsh, int pos) {
		if(get(hsh1, hsh) == -1)
			v[hsh1].push_back({hsh, pos});
	}

	int get(int hsh1, int hsh) {
		for(auto i : v[hsh1])
			if(i.st == hsh1)
				return i.nd;
		return -1;
	}
} hhh;

int main() {
	ios_base::sync_with_stdio(false);

	cin >> n >> a >> b;
	cin >> s;

	s = "#" + s;

	for(int i = 1; i <= n; i++) {
		dp[i] = dp[i - 1] + a;

		hsh = 0;
		hsh1 = 0;
		for(int j = i; j >= 1; j--) {
			hsh = (hsh * B + s[j] - 'a' + 1) % MOD;
			hsh1 = (hsh1 * B + s[j] - 'a' + 1) % MODH;

			int min_val = hhh.get(hsh1, hsh);

			if(min_val != -1) {
				if(min_val < j)
					dp[i] = min(dp[i], dp[j - 1] + b);
			} else
				hhh.add(hsh1, hsh, i);
		}
	}
	// dbg_v(dp, n+ 1);
	cout << dp[n] << '\n';
}


#include <bits/stdc++.h>
#define st first
#define nd second

using namespace std;
using ull = unsigned long long;

void debug_out() { cerr << endl; }
template<class T> ostream& prnt(ostream& out, T v) { out << v.size() << '\n'; for(auto e : v) out << e << ' '; return out;}
template<class T> ostream& operator<<(ostream& out, vector <T> v) { return prnt(out, v); }
template<class T> ostream& operator<<(ostream& out, set <T> v) { return prnt(out, v); }
template<class T1, class T2> ostream& operator<<(ostream& out, map <T1, T2> v) { return prnt(out, v); }
template<class T1, class T2> ostream& operator<<(ostream& out, pair<T1, T2> p) { return out << '(' << p.st << ' ' << p.nd << ')'; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) { cerr << " " << H; debug_out(T...);}

#define dbg(...) cerr << #__VA_ARGS__ << " ->", debug_out(__VA_ARGS__)
#define dbg_v(x, n) do{cerr<<#x"[]: ";for(int _=0;_<n;++_)cerr<<x[_]<<" ";cerr<<'\n';}while(0)
#define dbg_ok cerr<<"OK!\n"

const int N = 5005;
const ull B = 31;
int n, a, b, dp[N];
ull hsh;
string s;

map <ull, int> fst[N];

int main() {
	ios_base::sync_with_stdio(false);

	cin >> n >> a >> b;
	cin >> s;

	s = "#" + s;

	for(int i = 1; i <= n; i++) {
		dp[i] = dp[i - 1] + a;

		hsh = 0;
		for(int j = i; j >= 1; j--) {
			hsh = hsh * B + s[j] - 'a' + 1;

			// dbg(i, j, hsh);
			if(fst[i - j + 1].count(hsh)) {
				// dbg(fst[i - j + 1][hsh], dp[j - 1]);
				if(fst[i - j + 1][hsh] < j)
					dp[i] = min(dp[i], dp[j - 1] + b);
			} else fst[i - j + 1][hsh] = i;
			// dbg(dp[i]);
		}
	}
	// dbg_v(dp, n+ 1);
	cout << dp[n] << '\n';
}


#include <bits/stdc++.h>
#define st first
#define nd second

using namespace std;
using ull = long long;

void debug_out() { cerr << endl; }
template<class T> ostream& prnt(ostream& out, T v) { out << v.size() << '\n'; for(auto e : v) out << e << ' '; return out;}
template<class T> ostream& operator<<(ostream& out, vector <T> v) { return prnt(out, v); }
template<class T> ostream& operator<<(ostream& out, set <T> v) { return prnt(out, v); }
template<class T1, class T2> ostream& operator<<(ostream& out, map <T1, T2> v) { return prnt(out, v); }
template<class T1, class T2> ostream& operator<<(ostream& out, pair<T1, T2> p) { return out << '(' << p.st << ' ' << p.nd << ')'; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) { cerr << " " << H; debug_out(T...);}

#define dbg(...) cerr << #__VA_ARGS__ << " ->", debug_out(__VA_ARGS__)
#define dbg_v(x, n) do{cerr<<#x"[]: ";for(int _=0;_<n;++_)cerr<<x[_]<<" ";cerr<<'\n';}while(0)
#define dbg_ok cerr<<"OK!\n"

const int N = 5005;
const ull B = 31;
const int MOD = 1e9 + 7;
const int MODH = 2e6 + 67013;
int n, a, b, dp[N];
ull hsh, hsh1;
string s;

struct hasher {

	vector <pair <int, int> > v[MODH];

	void add(int hsh1, int hsh, int pos) {
		if(get(hsh1, hsh) == -1)
			v[hsh1].push_back({hsh, pos});
	}

	int get(int hsh1, int hsh) {
		for(auto i : v[hsh1])
			if(i.st == hsh1)
				return i.nd;
		return -1;
	}
} hhh;

int main() {
	ios_base::sync_with_stdio(false);

	cin >> n >> a >> b;
	cin >> s;

	s = "#" + s;

	for(int i = 1; i <= n; i++) {
		dp[i] = dp[i - 1] + a;

		hsh = 0;
		hsh1 = 0;
		for(int j = i; j >= 1; j--) {
			hsh = (hsh * B + s[j] - 'a' + 1) % MOD;
			hsh1 = (hsh1 * 37 + s[j] - 'a' + 1) % MODH;

			int min_val = hhh.get(hsh1, hsh);

			if(min_val != -1) {
				if(min_val < j)
					dp[i] = min(dp[i], dp[j - 1] + b);
			} else
				hhh.add(hsh1, hsh, i);
		}
	}
	// dbg_v(dp, n+ 1);
	cout << dp[n] << '\n';
}


#include <bits/stdc++.h>
#define st first
#define nd second

using namespace std;
using ull = long long;

void debug_out() { cerr << endl; }
template<class T> ostream& prnt(ostream& out, T v) { out << v.size() << '\n'; for(auto e : v) out << e << ' '; return out;}
template<class T> ostream& operator<<(ostream& out, vector <T> v) { return prnt(out, v); }
template<class T> ostream& operator<<(ostream& out, set <T> v) { return prnt(out, v); }
template<class T1, class T2> ostream& operator<<(ostream& out, map <T1, T2> v) { return prnt(out, v); }
template<class T1, class T2> ostream& operator<<(ostream& out, pair<T1, T2> p) { return out << '(' << p.st << ' ' << p.nd << ')'; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) { cerr << " " << H; debug_out(T...);}

#define dbg(...) cerr << #__VA_ARGS__ << " ->", debug_out(__VA_ARGS__)
#define dbg_v(x, n) do{cerr<<#x"[]: ";for(int _=0;_<n;++_)cerr<<x[_]<<" ";cerr<<'\n';}while(0)
#define dbg_ok cerr<<"OK!\n"

const int N = 5005;
const ull B = 31;
const int MOD = 1e9 + 17;
const int MODH = 1e6 + 67013;
int n, a, b, dp[N];
ull hsh, hsh1;
string s;

struct hasher {

	vector <pair<pair <int, int> , int >> v[MODH];

	void add(int hsh1, int hsh, int lg, int pos) {
		if(get(hsh1, hsh, lg) == -1)
			v[hsh1].push_back({{hsh, lg}, pos});
	}

	int get(int hsh1, int hsh, int lg) {
		for(auto i : v[hsh1])
			if(i.st == make_pair(hsh, lg))
				return i.nd;
		return -1;
	}
} hhh;

int main() {
	ios_base::sync_with_stdio(false);

	cin >> n >> a >> b;
	cin >> s;

	s = "#" + s;

	for(int i = 1; i <= n; i++) {
		dp[i] = dp[i - 1] + a;

		hsh = 0;
		hsh1 = 0;
		for(int j = i; j >= 1; j--) {
			hsh = (hsh * B + s[j] - 'a' + 1) % MOD;
			hsh1 = (hsh1 * B + s[j] - 'a' + 1) % MODH;

			int min_val = hhh.get(hsh1, hsh, i - j + 1);

			if(min_val != -1) {
				if(min_val < j)
					dp[i] = min(dp[i], dp[j - 1] + b);
			} else
				hhh.add(hsh1, hsh, i - j + 1, i);
		}
	}
	// dbg_v(dp, n+ 1);
	cout << dp[n] << '\n';
}


#include<bits/stdc++.h>
using namespace std;
int failure[5001];
void build_failure(char str[],int length)
{
    int i,j,k;
    int cur;
    failure[0]=0;
    failure[1]=0;
    for(i=2;i<=length;i++){
        cur=i-1;
        while(cur!=0){
           if(str[failure[cur]]==str[i-1]){
              failure[i]=failure[cur]+1;
              break;
           }
           cur=failure[cur];
        }
    }
}
int kmp(char text[],char pat[],int tl,int pl)
{
    int i,j,k;
    int cur=0;
    int max_length=0;
    for(i=0;i<tl;){
        if(cur==pl)
            return pl;
        if(text[i]!=pat[cur] ){
            if(cur>max_length)
               max_length=cur;
            if(cur==0)
              i++;
            cur=failure[cur];
        }
        else {
            cur++;
            i++;
        }
    }
    if(cur>max_length)
       max_length=cur;
    if(cur==pl)
        return pl;
    return max_length;
}
int main()
{
    int i,j,k;
    int n,a,b;
    int tl,pl,l;
    int min_cost;
    int lcs;
    int incr;
    char text[5001],pat[5001];
    char str[5001];
    scanf("%d%d%d",&n,&a,&b);
    scanf("%s",str);
    l=strlen(str);
    min_cost=a;
    text[0]=str[0];
    tl=1;
    while(tl<l){
        pl=l-tl;
        for(i=0;i<pl;i++)
            pat[i]=str[i+tl];
        memset(failure,0,sizeof failure);
        build_failure(pat,pl);
        lcs=kmp(text,pat,tl,pl);
        //printf("%d\n",lcs);
        if(b<=(a*lcs)){
            min_cost+=b;
            incr=lcs;
        }
        else if(lcs==0){
            min_cost+=a;
            incr=1;
        }
        else {
            min_cost+=(lcs*a);
            incr=lcs;
        }
        for(i=0;i<incr;i++,tl++)
            text[tl]=pat[i];
    }
    printf("%d",min_cost);
}


#include<bits/stdc++.h>
using namespace std;
int failure[5001];
void build_failure(char str[],int length)
{
    int i,j,k;
    int cur;
    failure[0]=0;
    failure[1]=0;
    for(i=2;i<=length;i++){
        cur=i-1;
        while(cur!=0){
           if(str[failure[cur]]==str[i-1]){
              failure[i]=failure[cur]+1;
              break;
           }
           cur=failure[cur];
        }
    }
}
int kmp(char text[],char pat[],int tl,int pl)
{
    int i,j,k;
    int cur=0;
    int max_length=0;
    for(i=0;i<tl;){
        if(cur==pl)
            return pl;
        if(text[i]!=pat[cur] ){
            if(cur>max_length)
               max_length=cur;
            if(cur==0)
              i++;
            cur=failure[cur];
        }
        else {
            cur++;
            i++;
        }
    }
    if(cur>max_length)
       max_length=cur;
    if(cur==pl)
        return pl;
    return max_length;
}
int main()
{
    int i,j,k;
    int n,a,b;
    int tl,pl,l;
    int min_cost;
    int lcs;
    int incr;
    char text[5001],pat[5001];
    char str[5001];
    scanf("%d%d%d",&n,&a,&b);
    scanf("%s",str);
    l=strlen(str);
    min_cost=a;
    text[0]=str[0];
    tl=1;
    while(tl<l){
        pl=l-tl;
        for(i=0;i<pl;i++)
            pat[i]=str[i+tl];
        memset(failure,0,sizeof failure);
        build_failure(pat,pl);
        lcs=kmp(text,pat,tl,pl);
        //printf("%d\n",lcs);
        if(b<(a*lcs)){
            min_cost+=b;
            incr=lcs;
        }
        else {
            min_cost+=a;
            incr=1;
        }
        for(i=0;i<incr;i++,tl++)
            text[tl]=pat[i];
    }
    printf("%d",min_cost);
}


#include<bits/stdc++.h>
using namespace std;
int failure[5001];
void build_failure(char str[],int length)
{
    int i,j,k;
    int cur;
    failure[0]=0;
    failure[1]=0;
    for(i=2;i<=length;i++){
        cur=i-1;
        while(cur!=0){
           if(str[failure[cur]]==str[i-1]){
              failure[i]=failure[cur]+1;
              break;
           }
           cur=failure[cur];
        }
    }
}
int kmp(char text[],char pat[],int tl,int pl)
{
    int i,j,k;
    int cur=0;
    int max_length=0;
    for(i=0;i<tl;){
        if(cur==pl)
            return pl;
        if(text[i]!=pat[cur] ){
            if(cur>max_length)
               max_length=cur;
            if(cur==0)
              i++;
            cur=failure[cur];
        }
        else {
            cur++;
            i++;
        }
    }
    if(cur>max_length)
       max_length=cur;
    if(cur==pl)
        return pl;
    return max_length;
}
int main()
{
    int i,j,k;
    int n,a,b;
    int tl,pl,l;
    int min_cost;
    int lcs;
    int incr;
    char text[5001],pat[5001];
    char str[5001];
    scanf("%d%d%d",&n,&a,&b);
    scanf("%s",str);
    l=strlen(str);
    min_cost=a;
    text[0]=str[0];
    tl=1;
    while(tl<l){
        pl=l-tl;
        for(i=0;i<pl;i++)
            pat[i]=str[i+tl];
        memset(failure,0,sizeof failure);
        build_failure(pat,pl);
        lcs=kmp(text,pat,tl,pl);
        //printf("%d\n",lcs);
        if(b<=(a*lcs)){
            min_cost+=b;
            incr=lcs;
        }
        else {
            min_cost+=a;
            incr=1;
        }
        for(i=0;i<incr;i++,tl++)
            text[tl]=pat[i];
    }
    printf("%d",min_cost);
}


#include<bits/stdc++.h>
#define MAX 100000000;
using namespace std;
int failure[5001];
int subbed[5001][5001];
void build_failure(char str[],int length)
{
    int i,j,k;
    int cur;
    failure[0]=0;
    failure[1]=0;
    for(i=2;i<=length;i++){
        cur=i-1;
        while(cur!=0){
           if(str[failure[cur]]==str[i-1]){
              failure[i]=failure[cur]+1;
              break;
           }
           cur=failure[cur];
        }
    }
}
void kmp(char text[],char pat[],int tl,int pl)
{
    int i,j,k;
    int cur=0;
    for(i=0;i<tl;){
        if(cur==pl){
           subbed[tl][pl]=1;
           return ;
        }
        if(text[i]!=pat[cur] ){
            if(cur==0)
              i++;
            cur=failure[cur];
        }
        else {
            cur++;
            i++;
            subbed[tl][cur]=1;
        }
    }
    if(cur==pl)
        subbed[tl][pl]=1;

}
int dp[5001];
int main()
{
   int i,j,k,l;
   int a,b;
   int temp;
   int tl,pl;
   char str[5001];
   char txt[5001],pat[5001];
   scanf("%d %d %d",&l,&a,&b);
   scanf("%s",str);
   //subconstruction
   for(i=1;i<=l;i++)
       subbed[0][i]=0;
   for(tl=1;tl<l;tl++){
       for(j=0;j<tl;j++)
           txt[j]=str[j];
       for(pl=0;j<l;pl++,j++)
           pat[pl]=str[j];
       memset(failure,0,sizeof failure);
       build_failure(pat,pl);
       kmp(txt,pat,tl,pl);
   }
   dp[0]=0;
   dp[1]=a;
   for(i=2;i<=l;i++){
       dp[i]=MAX;
       for(j=1;j<i;j++){
          if(subbed[j][i-j]){
             dp[i]=dp[j]+b;
             break;
          }
       }
       dp[i]=min(dp[i],dp[i-1]+a);
       //printf("%d\n",dp[i]);
   }
   printf("%d",dp[l]);

}


#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(ll i = (a); i < (b); i++)
#define iter(it,c) for(auto it = (c).begin(); it != (c).end();++it)
#define pb push_back
#define fs first
#define sc second
typedef pair<ll,ll> ii;
typedef vector<ll> vi;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef vector<vii> vvii;

const ll INF = ~(1<<31);
const double pi = acos(-1);
const double EPS = 1e-9;
typedef unsigned long long ull;

template <class T> T smod(T a, T b) {
  return (a % b + b) % b; }

ll TO[5020];

ll memo[5020];
ll n,a,b;
ll dp(ll at) {
    if(at >= n) return 0;
    if(memo[at] != -1) return memo[at];
    ll val = dp(at+1)+a;
    if(TO[at] != at) val = min(val, dp(TO[at])+b);
    return memo[at] = val;
}

struct hasher { ll b = 311, m; vi h, p;
  hasher(string s, ll _m)
    : m(_m), h(size(s)+1), p(size(s)+1) {
    p[0] = 1; h[0] = 0;
    rep(i,0,size(s)) p[i+1] = (ll)p[i] * b % m;
    rep(i,0,size(s)) h[i+1] = ((ll)h[i] * b + s[i]) % m; }
  ll hash(ll l, ll r) {
    return (h[r+1] + m - (ll)h[l] * p[r-l+1] % m) % m; } };

int main() {
    cin.sync_with_stdio(false);
    memset(memo,-1,sizeof(memo));
    cin >> n >> a >> b;
    string S;
    cin >> S;
    hasher H(S, 1000000000+7);
    hasher H1(S, 1000000000+9);
    rep(i,0,n) TO[i] = i;
    rep(i,0,n) {
        ll lo = 1, hi = min(n-i-1,i+1);
        ll bst = 0;
        while(lo <= hi) {
            ll mid = (lo+hi)/2;
            bool good = false;
            for(ll j = 0; j < i-mid+2; j++) {
                if(good) break;
                if(H.hash(i+1,i+mid) == H.hash(j,j+mid-1)
                 && H1.hash(i+1,i+mid) == H1.hash(j,j+mid-1)) good = true;
            }
            if(good) {
                bst = mid;
                lo = mid+1;
            } else {
                hi = mid-1;
            }
        }
        TO[i+1] = i+1+bst;
    }
    cout << dp(0) << endl;
    return 0;
}


#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(ll i = (a); i < (b); i++)
#define iter(it,c) for(auto it = (c).begin(); it != (c).end();++it)
#define pb push_back
#define fs first
#define sc second
typedef pair<ll,ll> ii;
typedef vector<ll> vi;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef vector<vii> vvii;

const ll INF = ~(1<<31);
const double pi = acos(-1);
const double EPS = 1e-9;
typedef unsigned long long ull;

template <class T> T smod(T a, T b) {
  return (a % b + b) % b; }

ll TO[5020];

ll memo[5020];
ll n,a,b;
ll dp(ll at) {
    if(at >= n) return 0;
    if(memo[at] != -1) return memo[at];
    ll val = dp(at+1)+a;
    if(TO[at] != at) val = min(val, dp(TO[at])+b);
    return memo[at] = val;
}

struct hasher { ll b = 311, m; vi h, p;
  hasher(string s, ll _m)
    : m(_m), h(size(s)+1), p(size(s)+1) {
    p[0] = 1; h[0] = 0;
    rep(i,0,size(s)) p[i+1] = (ll)p[i] * b % m;
    rep(i,0,size(s)) h[i+1] = ((ll)h[i] * b + s[i]) % m; }
  ll hash(ll l, ll r) {
    return (h[r+1] + m - (ll)h[l] * p[r-l+1] % m) % m; } };

int main() {
    cin.sync_with_stdio(false);
    memset(memo,-1,sizeof(memo));
    cin >> n >> a >> b;
    string S;
    cin >> S;
    hasher H(S, 1000000000+7);
    rep(i,0,n) TO[i] = i;
    rep(i,0,n) {
        ll lo = 1, hi = min(n-i-1,i+1);
        ll bst = 0;
        while(lo <= hi) {
            ll mid = (lo+hi)/2;
            bool good = false;
            for(ll j = 0; j < i-mid+2; j++) {
                if(H.hash(i+1,i+mid) == H.hash(j,j+mid-1)) good = true;
            }
            if(good) {
                bst = mid;
                lo = mid+1;
            } else {
                hi = mid-1;
            }
        }
        TO[i+1] = i+1+bst;
    }
    cout << dp(0) << endl;
    return 0;
}


#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(int i = (a); i < (b); i++)
#define iter(it,c) for(auto it = (c).begin(); it != (c).end();++it)
#define pb push_back
#define fs first
#define sc second
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef vector<vii> vvii;

const int INF = ~(1<<31);
const double pi = acos(-1);
const double EPS = 1e-9;
typedef unsigned long long ull;

template <class T> T smod(T a, T b) {
  return (a % b + b) % b; }

struct rollh {
    vi H,P;
    vvi BP;
    ll B, sz = 0;
    rollh(ll _B, vi _P, ll n) {
        B = (_B+1); P = _P; H = vi(size(P),0);
        rep(i,0,size(P)) {
            vi H;
            ll val = 1;
            rep(j,0,n+1) {
                H.pb(val);
                val = (val * B) % P[i];
            }
            BP.pb(H);
        }
    }
    void push_back(char c) {
        ll val = c+1;
        rep(i,0,size(H)) H[i] = (H[i] * B + val) % P[i];
        sz++;
    }
    void push_front(char c) {
        ll val = c+1;
        rep(i,0,size(H)) H[i] = (H[i] + (val * BP[i][sz]) % P[i]) % P[i];
        sz++;
    }
    void pop_front(char c) {
        ll val = c+1;
        rep(i,0,size(H)) H[i] = (H[i] - (val * BP[i][sz-1]) % P[i] + P[i]) % P[i];
        sz--;
    }
    bool operator==(const rollh &a) {
        if(sz != a.sz) return false;
        rep(i,0,size(H)) {
            if(H[i] != a.H[i]) return false;
        }
        return true;
    }
};

int TO[5020];

int memo[5020];
int n,a,b;
int dp(int at) {
    if(at >= n) return 0;
    if(memo[at] != -1) return memo[at];
    int val = dp(at+1)+a;
    if(TO[at] != at) val = min(val, dp(TO[at])+b);
    return memo[at] = val;
}

int main() {
    cin.sync_with_stdio(false);
    rollh A(300, {1000000000+7,1000000000+9}, 5020);
    rollh B(300, {1000000000+7,1000000000+9}, 5020);
    memset(memo,-1,sizeof(memo));
    cin >> n >> a >> b;
    string S;
    cin >> S;
    rep(i,0,n) TO[i] = i;
    rep(i,0,n) {
        int lo = 1, hi = min(n-i-1,i+1);
        int bst = 0;
        while(lo <= hi) {
            int mid = (lo+hi)/2;
            string s = "";
            rep(j,i+1,i+1+mid) {
                s += S[j];
                A.push_front(S[j]);
            }
            for(int j = i; j >= i-mid+1; j--) {
                B.push_back(S[j]);
            }
            bool good = false;
            if(A == B) good = true;
            for(int j = i-mid; j >= 0; j--) {
                B.pop_front(S[j+mid]);
                B.push_back(S[j]);
                if(A == B) good = true;
            }
            for(int j = mid-1; j >= 0; j--) {
                B.pop_front(S[j]);
            }
            // clear
            for(int j = i+1+mid-1; j >= i+1; j--) A.pop_front(S[j]);
            if(good) {
                bst = mid;
                lo = mid+1;
            } else {
                hi = mid-1;
            }
        }
        TO[i] = i+bst;
    }
    cout << dp(0) << endl;
    return 0;
}


#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(ll i = (a); i < (b); i++)
#define iter(it,c) for(auto it = (c).begin(); it != (c).end();++it)
#define pb push_back
#define fs first
#define sc second
typedef pair<ll,ll> ii;
typedef vector<ll> vi;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef vector<vii> vvii;

const ll INF = ~(1<<31);
const double pi = acos(-1);
const double EPS = 1e-9;
typedef unsigned long long ull;

template <class T> T smod(T a, T b) {
  return (a % b + b) % b; }

ll TO[5020];

ll memo[5020];
ll n,a,b;
ll dp(ll at) {
    if(at >= n) return 0;
    if(memo[at] != -1) return memo[at];
    ll val = dp(at+1)+a;
    if(TO[at] != at) val = min(val, dp(TO[at])+b);
    return memo[at] = val;
}

struct hasher { ll b = 311, m; vi h, p;
  hasher(string s, ll _m)
    : m(_m), h(size(s)+1), p(size(s)+1) {
    p[0] = 1; h[0] = 0;
    rep(i,0,size(s)) p[i+1] = (ll)p[i] * b % m;
    rep(i,0,size(s)) h[i+1] = ((ll)h[i] * b + s[i]) % m; }
  ll hash(ll l, ll r) {
    return (h[r+1] + m - (ll)h[l] * p[r-l+1] % m) % m; } };

int main() {
    cin.sync_with_stdio(false);
    memset(memo,-1,sizeof(memo));
    cin >> n >> a >> b;
    string S;
    cin >> S;
    hasher H(S, 1000000000+7);
    hasher H1(S, 1000000000+9);
    rep(i,0,n) TO[i] = i;
    rep(i,0,n) {
        ll lo = 1, hi = min(n-i-1,i+1);
        ll bst = 0;
        while(lo <= hi) {
            ll mid = (lo+hi)/2;
            bool good = false;
            for(ll j = 0; j < i-mid+2; j++) {
                if(H.hash(i+1,i+mid) == H.hash(j,j+mid-1)
                 && H1.hash(i+1,i+mid) == H1.hash(j,j+mid-1)) good = true;
            }
            if(good) {
                bst = mid;
                lo = mid+1;
            } else {
                hi = mid-1;
            }
        }
        TO[i+1] = i+1+bst;
    }
    cout << dp(0) << endl;
    return 0;
}


#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(ll i = (a); i < (b); i++)
#define iter(it,c) for(auto it = (c).begin(); it != (c).end();++it)
#define pb push_back
#define fs first
#define sc second
typedef pair<ll,ll> ii;
typedef vector<ll> vi;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef vector<vii> vvii;

const ll INF = ~(1<<31);
const double pi = acos(-1);
const double EPS = 1e-9;
typedef unsigned long long ull;

template <class T> T smod(T a, T b) {
  return (a % b + b) % b; }

ll TO[5020];

ll memo[5020];
ll n,a,b;
ll dp(ll at) {
    if(at >= n) return 0;
    if(memo[at] != -1) return memo[at];
    ll val = dp(at+1)+a;
    if(TO[at] != at) val = min(val, dp(TO[at])+b);
    return memo[at] = val;
}

struct hasher { ll b = 311, m; vi h, p;
  hasher(string s, ll _m)
    : m(_m), h(size(s)+1), p(size(s)+1) {
    p[0] = 1; h[0] = 0;
    rep(i,0,size(s)) p[i+1] = (ll)p[i] * b % m;
    rep(i,0,size(s)) h[i+1] = ((ll)h[i] * b + s[i]) % m; }
  ll hash(ll l, ll r) {
    return (h[r+1] + m - (ll)h[l] * p[r-l+1] % m) % m; } };

int main() {
    cin.sync_with_stdio(false);
    memset(memo,-1,sizeof(memo));
    cin >> n >> a >> b;
    string S;
    cin >> S;
    hasher H(S, 1000000000+7);
    rep(i,0,n) TO[i] = i;
    rep(i,0,n) {
        ll lo = 1, hi = min(n-i-1,i+1);
        ll bst = 0;
        while(lo <= hi) {
            ll mid = (lo+hi)/2;
            bool good = false;
            for(ll j = 0; j < i-mid+2; j++) {
                if(H.hash(i+1,i+mid) == H.hash(j,j+mid-1)) good = true;
            }
            if(good) {
                bst = mid;
                lo = mid+1;
            } else {
                hi = mid-1;
            }
        }
        TO[i] = i+bst;
    }
    cout << dp(0) << endl;
    return 0;
}


/*input
4 10 1
aaaa

*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
ll W = 57;
const ll modulo = 1000000007;
int main()
{
	ios_base::sync_with_stdio(false);
	ll n, a, b;
	cin >> n >> a >> b;
	string s;
	cin >> s;
	s = "{" + s;
	ll DP[n + 1];
	DP[0] = 0;
	ll H[n + 1];
	ll w[n + 1];
	H[0] = 0;
	w[0] = 1;
	for (ll i = 1; i <= n; i++)
		w[i] = (w[i - 1] * W) % modulo;
	map<ll, ll>pirmas;
	for (ll i = 1; i <= n; i++)
	{
		H[i] = H[i - 1];
		H[i] += w[i] * ll(s[i] - 'a' + 1);
		H[i] %= modulo;
	}
	set<char>buvo;
	for (ll i = 1; i <= n; i++)
	{
		DP[i] = DP[i - 1] + a;
		if (buvo.count(s[i]))
		{
			ll lo = 1;
			ll hi = i;
			while (lo < hi)
			{
				ll sz = (lo + hi + 1) / 2;
				bool ok = false;
				for (ll j = i - sz; j >= sz; j--)
				{
					ll H1 = (H[i] - H[i - sz] + modulo) % modulo;
					ll H2 = (H[j] - H[j - sz] + modulo) % modulo;
					H2 *= w[i - j];
					H2 %= modulo;
					if (H1 == H2)
						ok = true;
				}
				if (ok)
					lo = sz;
				else
					hi = sz - 1;
			}
			ll sz = (lo + hi) / 2;
			DP[i] = min(DP[i], DP[i - sz] + b);
		}
		buvo.insert(s[i]);
	}
	cout << DP[n] << endl;
}


/*input
4 1 1
abcd

*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
ll W = 57;
const ll modulo = 1000000007;
int main()
{
	ios_base::sync_with_stdio(false);
	int n, a, b;
	cin >> n >> a >> b;
	string s;
	cin >> s;
	s = "{" + s;
	int DP[n + 1];
	DP[0] = 0;
	ll H[n + 1];
	ll w[n + 1];
	H[0] = 0;
	w[0] = 1;
	for (int i = 1; i <= n; i++)
		w[i] = (w[i - 1] * W) % modulo;
	map<ll, int>pirmas;
	for (int i = 1; i <= n; i++)
	{
		H[i] = H[i - 1];
		H[i] += w[i] * ll(s[i] - 'a' + 1);
		H[i] %= modulo;
		DP[i] = DP[i - 1] + a;
		for (int j = i; j >= 1; j--)
		{
			ll suma = (H[i] - H[j - 1] + modulo) % modulo;
			suma = (suma * w[n - j]) % modulo;
			if (pirmas.count(suma) == 0)
				pirmas[suma] = i;
			if (pirmas[suma] < j)
				DP[i] = min(DP[i], DP[j - 1] + b);
		}
	}
	cout << DP[n] << endl;
}


/*input
4 10 1
aaaa
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
struct trie
{
	trie* vaikai[26];
	int pirmas = 10000;
	trie(int pirmas = 10000): pirmas(pirmas)
	{
		for (int i = 0; i < 26; i++)
			vaikai[i] = NULL;
	}
};
trie* tuscias = new trie();
int main()
{
	ios_base::sync_with_stdio(false);
	int n, a, b;
	cin >> n >> a >> b;
	string s;
	cin >> s;
	s = "{" + s;
	int DP[n + 1];
	DP[0] = 0;
	for (int i = 1; i <= n; i++)
	{
		DP[i] = DP[i - 1] + a;
		trie* kur = tuscias;
		for (int j = i; j >= 1; j--)
		{
			if (kur->vaikai[s[j] - 'a'] == NULL)
				kur->vaikai[s[j] - 'a'] = new trie(i);
			kur = kur->vaikai[s[j] - 'a'];
			if (kur->pirmas < j)
				DP[i] = min(DP[i], DP[j - 1] + b);
		}
	}
	cout << DP[n] << endl;
}


/*input
4 10 1
aaaa
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
int id[5000 * 2500 + 1][26];
int pirmas[5000 * 5000 + 1];
int timer = 1;
int main()
{
	ios_base::sync_with_stdio(false);
	int n, a, b;
	cin >> n >> a >> b;
	string s;
	cin >> s;
	s = "{" + s;
	int DP[n + 1];
	DP[0] = 0;
	for (int i = 1; i <= n; i++)
	{
		DP[i] = DP[i - 1] + a;
		int kur = 0;
		for (int j = i; j >= 1; j--)
		{
			if (id[kur][s[j] - 'a'] == 0)
			{
				pirmas[timer] = i;
				id[kur][s[j] - 'a'] = timer++;
			}
			kur = id[kur][s[j] - 'a'];
			if (pirmas[kur] < j)
				DP[i] = min(DP[i], DP[j - 1] + b);
		}
	}
	cout << DP[n] << endl;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pi acos(-1)
#define db double
#define N 5005
int rk[N+N],sa[N],tsa[N],cnta[N],cntb[N],a[N],b[N],h[N];
int st[N][20];
int dp[N];
inline int rmq(int l,int r)
{
    if (l>r) swap(l,r);
    ++l;
    int len=r-l+1;
    len=log2(len);
    return min(st[l][len],st[r-(1<<len)+1][len]);
}
int check(int k,int m)
{
    int res=min(rmq(rk[1],rk[k]),k-1);
    if (res>=m-k+1) return 1;
    return 0;
}
char stt[N];
void SA(char *st)
{
    int n=strlen(st+1);
    for (int i=0;i<=2*n;++i) rk[i]=0;
    for (int i=0;i<=26;++i) cnta[i]=0;
    for (int i=1;i<=n;++i) ++cnta[a[i]=(st[i]-'a'+1)];
    for (int i=1;i<=26;++i) cnta[i]+=cnta[i-1];
    for (int i=n;i;--i) sa[cnta[a[i]]--]=i;
    rk[sa[1]]=1;
    for (int i=2;i<=n;++i) rk[sa[i]]=rk[sa[i-1]] + (a[sa[i]]!=a[sa[i-1]]);
    for (int l=1;rk[sa[n]]!=n;l<<=1)
    {
        for (int i=0;i<=n;++i) cnta[i]=cntb[i]=0;
        for (int i=1;i<=n;++i) ++cnta[a[i]=rk[i]],++cntb[b[i]=rk[i+l]];
        for (int i=1;i<=n;++i) cnta[i]+=cnta[i-1],cntb[i]+=cntb[i-1];
        for (int i=n;i;--i) tsa[cntb[b[i]]--]=i;
        for (int i=n;i;--i) sa[cnta[a[tsa[i]]]--]=tsa[i];
        rk[sa[1]]=1;
        for (int i=2;i<=n;++i) rk[sa[i]]=rk[sa[i-1]] + (a[sa[i-1]]!=a[sa[i]] || b[sa[i-1]]!=b[sa[i]]);
    }
    int l=0;
    for (int i=1;i<=n;++i)
    {
        if (l) --l;
        while (i+l<=n && sa[rk[i]-1]+l<=n && st[i+l]==st[sa[rk[i]-1]+l]) ++l;
        h[rk[i]]=l;
    }
    h[1]=0;
}
int n,c1,c2;
int main()
{
    cin>>n>>c1>>c2;
    scanf("%s",stt+1);
    SA(stt);
    //for (int i=1;i<=n;++i) cout<<rk[i]<<' ';cout<<endl;
    //for (int i=1;i<=n;++i) cout<<sa[i]<<' ';cout<<endl;
    //for (int i=1;i<=n;++i) cout<<h[i]<<' ';cout<<endl;
    for (int i=1;i<=n;++i) st[i][0]=h[i];
    for (int i=1;i<=log2(n);++i)
    {
        for (int j=1;j+(1<<i)-1<=n;++j)
            st[j][i]=min(st[j][i-1],st[j+(1<<(i-1))][i-1]);
    }
    for (int i=1;i<=n;++i)
    {
        dp[i]=dp[i-1]+c1;
        int l=1,r=i+1;
        while (l<r)
        {
            int mid=(l+r)>>1;
            if (check(mid,i)) r=mid;else l=mid+1;
        }
        if (r<=i) dp[i]=min(dp[i],dp[l-1]+c2);
        //cout<<i<<' '<<l<<' '<<dp[i]<<endl;
    }
    cout<<dp[n]<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pi acos(-1)
#define db double
#define N 5005
int rk[N+N],sa[N],tsa[N],cnta[N],cntb[N],a[N],b[N],h[N];
int st[N][20];
int dp[N];
inline int rmq(int l,int r)
{
    if (l>r) swap(l,r);
    ++l;
    int len=r-l+1;
    len=(int)(log2(len)+1e-8);
    return min(st[l][len],st[r-(1<<len)+1][len]);
}
int check(int k,int m)
{
    for (int i=1;i<k;++i)
    {
        int res=min(rmq(rk[i],rk[k]),k-i);
        if (res>=m-k+1) return 1;
    }
    return 0;
}
char stt[N];
void SA(char *st)
{
    int n=strlen(st+1);
    for (int i=0;i<=2*n;++i) rk[i]=0;
    for (int i=0;i<=26;++i) cnta[i]=0;
    for (int i=1;i<=n;++i) ++cnta[a[i]=(st[i]-'a'+1)];
    for (int i=1;i<=26;++i) cnta[i]+=cnta[i-1];
    for (int i=n;i;--i) sa[cnta[a[i]]--]=i;
    rk[sa[1]]=1;
    for (int i=2;i<=n;++i) rk[sa[i]]=rk[sa[i-1]] + (a[sa[i]]!=a[sa[i-1]]);
    for (int l=1;rk[sa[n]]!=n;l<<=1)
    {
        for (int i=0;i<=n;++i) cnta[i]=cntb[i]=0;
        for (int i=1;i<=n;++i) ++cnta[a[i]=rk[i]],++cntb[b[i]=rk[i+l]];
        for (int i=1;i<=n;++i) cnta[i]+=cnta[i-1],cntb[i]+=cntb[i-1];
        for (int i=n;i;--i) tsa[cntb[b[i]]--]=i;
        for (int i=n;i;--i) sa[cnta[a[tsa[i]]]--]=tsa[i];
        rk[sa[1]]=1;
        for (int i=2;i<=n;++i) rk[sa[i]]=rk[sa[i-1]] + (a[sa[i-1]]!=a[sa[i]] || b[sa[i-1]]!=b[sa[i]]);
    }
    int l=0;
    for (int i=1;i<=n;++i)
    {
        if (l) --l;
        while (i+l<=n && sa[rk[i]-1]+l<=n && st[i+l]==st[sa[rk[i]-1]+l]) ++l;
        h[rk[i]]=l;
    }
    h[1]=0;
}
int n,c1,c2;
int main()
{
    cin>>n>>c1>>c2;
    scanf("%s",stt+1);
    SA(stt);
    //for (int i=1;i<=n;++i) cout<<rk[i]<<' ';cout<<endl;
    //for (int i=1;i<=n;++i) cout<<sa[i]<<' ';cout<<endl;
    //for (int i=1;i<=n;++i) cout<<h[i]<<' ';cout<<endl;
    for (int i=1;i<=n;++i) st[i][0]=h[i];
    for (int i=1;i<=log2(n);++i)
    {
        for (int j=1;j+(1<<i)-1<=n;++j)
            st[j][i]=min(st[j][i-1],st[j+(1<<(i-1))][i-1]);
    }
    for (int i=1;i<=n;++i)
    {
        dp[i]=dp[i-1]+c1;
        int l=1,r=i+1;
        while (l<r)
        {
            int mid=(l+r)>>1;
            if (check(mid,i)) r=mid;else l=mid+1;
        }
        if (r<=i) dp[i]=min(dp[i],dp[l-1]+c2);
        //cout<<i<<' '<<l<<' '<<dp[i]<<endl;
    }
    cout<<dp[n]<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pi acos(-1)
#define db double
#define N 5005
int rk[N+N],sa[N],tsa[N],cnta[N],cntb[N],a[N],b[N],h[N];
int st[N][20];
int st1[N][20];
int dp[N];
inline int rmq(int l,int r)
{
    if (l>r) swap(l,r);
    ++l;
    int len=r-l+1;
    len=(int)(log2(len)+1e-8);
    return min(st[l][len],st[r-(1<<len)+1][len]);
}
inline int rmq1(int l,int r)
{
    if (l>r) swap(l,r);
    int len=r-l+1;
    len=(int)(log2(len)+1e-8);
    return min(st1[l][len],st1[r-(1<<len)+1][len]);
}
int n,c1,c2;
int check(int k,int m)
{
    int l1,rr,l,r,lim=m-k+1;
    l1=1,rr=rk[k];
    while (l1<rr)
    {
        int mid=(l1+rr)>>1;
        if (rmq(mid,rk[k])>=lim) rr=mid;else l1=mid+1;
    }
    l=l1;
    l1=rk[k],rr=n;
    while (l1<rr)
    {
        int mid=(l1+rr+1)>>1;
        if (rmq(mid,rk[k])>=lim) l1=mid;else rr=mid-1;
    }
    r=rr;
    if (rmq1(l,r)+lim-1<k) return 1;
    return 0;
}
char stt[N];
void SA(char *st)
{
    int n=strlen(st+1);
    for (int i=0;i<=2*n;++i) rk[i]=0;
    for (int i=0;i<=26;++i) cnta[i]=0;
    for (int i=1;i<=n;++i) ++cnta[a[i]=(st[i]-'a'+1)];
    for (int i=1;i<=26;++i) cnta[i]+=cnta[i-1];
    for (int i=n;i;--i) sa[cnta[a[i]]--]=i;
    rk[sa[1]]=1;
    for (int i=2;i<=n;++i) rk[sa[i]]=rk[sa[i-1]] + (a[sa[i]]!=a[sa[i-1]]);
    for (int l=1;rk[sa[n]]!=n;l<<=1)
    {
        for (int i=0;i<=n;++i) cnta[i]=cntb[i]=0;
        for (int i=1;i<=n;++i) ++cnta[a[i]=rk[i]],++cntb[b[i]=rk[i+l]];
        for (int i=1;i<=n;++i) cnta[i]+=cnta[i-1],cntb[i]+=cntb[i-1];
        for (int i=n;i;--i) tsa[cntb[b[i]]--]=i;
        for (int i=n;i;--i) sa[cnta[a[tsa[i]]]--]=tsa[i];
        rk[sa[1]]=1;
        for (int i=2;i<=n;++i) rk[sa[i]]=rk[sa[i-1]] + (a[sa[i-1]]!=a[sa[i]] || b[sa[i-1]]!=b[sa[i]]);
    }
    int l=0;
    for (int i=1;i<=n;++i)
    {
        if (l) --l;
        while (i+l<=n && sa[rk[i]-1]+l<=n && st[i+l]==st[sa[rk[i]-1]+l]) ++l;
        h[rk[i]]=l;
    }
    h[1]=0;
}
int main()
{
    cin>>n>>c1>>c2;
    scanf("%s",stt+1);
    SA(stt);
    //for (int i=1;i<=n;++i) cout<<rk[i]<<' ';cout<<endl;
    //for (int i=1;i<=n;++i) cout<<sa[i]<<' ';cout<<endl;
    //for (int i=1;i<=n;++i) cout<<h[i]<<' ';cout<<endl;
    for (int i=1;i<=n;++i) st[i][0]=h[i],st1[i][0]=sa[i];
    for (int i=1;i<=log2(n);++i)
    {
        for (int j=1;j+(1<<i)-1<=n;++j)
            st[j][i]=min(st[j][i-1],st[j+(1<<(i-1))][i-1]),
            st1[j][i]=min(st1[j][i-1],st1[j+(1<<(i-1))][i-1]);
    }
    //cout<<"ok="<<check(2,2)<<endl;
    for (int i=1;i<=n;++i)
    {
        dp[i]=dp[i-1]+c1;
        int l=1,r=i+1;
        while (l<r)
        {
            int mid=(l+r)>>1;
            if (check(mid,i)) r=mid;else l=mid+1;
        }
        if (r<=i) dp[i]=min(dp[i],dp[l-1]+c2);
        //cout<<i<<' '<<l<<' '<<dp[i]<<endl;
    }
    cout<<dp[n]<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pi acos(-1)
#define db double
#define N 5005
int rk[N+N],sa[N],tsa[N],cnta[N],cntb[N],a[N],b[N],h[N];
int st[N][20];
int dp[N];
inline int rmq(int l,int r)
{
    if (l>r) swap(l,r);
    ++l;
    int len=r-l+1;
    len=log(len)/log(2);
    return min(st[l][len],st[r-(1<<len)+1][len]);
}
int check(int k,int m)
{
    int res=min(rmq(rk[1],rk[k]),k-1);
    if (res>=m-k+1) return 1;
    return 0;
}
char stt[N];
void SA(char *st)
{
    int n=strlen(st+1);
    for (int i=0;i<=2*n;++i) rk[i]=0;
    for (int i=0;i<=26;++i) cnta[i]=0;
    for (int i=1;i<=n;++i) ++cnta[a[i]=(st[i]-'a'+1)];
    for (int i=1;i<=26;++i) cnta[i]+=cnta[i-1];
    for (int i=n;i;--i) sa[cnta[a[i]]--]=i;
    rk[sa[1]]=1;
    for (int i=2;i<=n;++i) rk[sa[i]]=rk[sa[i-1]] + (a[sa[i]]!=a[sa[i-1]]);
    for (int l=1;rk[sa[n]]!=n;l<<=1)
    {
        for (int i=0;i<=n;++i) cnta[i]=cntb[i]=0;
        for (int i=1;i<=n;++i) ++cnta[a[i]=rk[i]],++cntb[b[i]=rk[i+l]];
        for (int i=1;i<=n;++i) cnta[i]+=cnta[i-1],cntb[i]+=cntb[i-1];
        for (int i=n;i;--i) tsa[cntb[b[i]]--]=i;
        for (int i=n;i;--i) sa[cnta[a[tsa[i]]]--]=tsa[i];
        rk[sa[1]]=1;
        for (int i=2;i<=n;++i) rk[sa[i]]=rk[sa[i-1]] + (a[sa[i-1]]!=a[sa[i]] || b[sa[i-1]]!=b[sa[i]]);
    }
    int l=0;
    for (int i=1;i<=n;++i)
    {
        if (l) --l;
        while (i+l<=n && sa[rk[i]-1]+l<=n && st[i+l]==st[sa[rk[i]-1]+l]) ++l;
        h[rk[i]]=l;
    }
    h[1]=0;
}
int n,c1,c2;
int main()
{
    cin>>n>>c1>>c2;
    scanf("%s",stt+1);
    SA(stt);
    //for (int i=1;i<=n;++i) cout<<rk[i]<<' ';cout<<endl;
    //for (int i=1;i<=n;++i) cout<<sa[i]<<' ';cout<<endl;
    //for (int i=1;i<=n;++i) cout<<h[i]<<' ';cout<<endl;
    for (int i=1;i<=n;++i) st[i][0]=h[i];
    for (int i=1;i<=log2(n);++i)
    {
        for (int j=1;j+(1<<i)-1<=n;++j)
            st[j][i]=min(st[j][i-1],st[j+(1<<(i-1))][i-1]);
    }
    for (int i=1;i<=n;++i)
    {
        dp[i]=dp[i-1]+c1;
        int l=1,r=i+1;
        while (l<r)
        {
            int mid=(l+r)>>1;
            if (check(mid,i)) r=mid;else l=mid+1;
        }
        if (r<=i) dp[i]=min(dp[i],dp[l-1]+c2);
        //cout<<i<<' '<<l<<' '<<dp[i]<<endl;
    }
    cout<<dp[n]<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pi acos(-1)
#define db double
#define N 5005
int rk[N+N],sa[N],tsa[N],cnta[N],cntb[N],a[N],b[N],h[N];
int st[N][20];
int st1[N][20];
int dp[N];
inline int rmq(int l,int r)
{
    if (l>r) swap(l,r);
    ++l;
    int len=r-l+1;
    len=(int)(log2(len)+1e-8);
    return min(st[l][len],st[r-(1<<len)+1][len]);
}
inline int rmq1(int l,int r)
{
    if (l>r) swap(l,r);
    int len=r-l+1;
    len=(int)(log2(len)+1e-8);
    return min(st1[l][len],st1[r-(1<<len)+1][len]);
}
int n,c1,c2;
int check(int k,int m)
{
    int l1,rr,l,r,lim=m-k+1;
    l1=1,rr=rk[k];
    while (l1<rr)
    {
        int mid=(l1+rr)>>1;
        if (rmq(mid,rk[k])>=lim) rr=mid;else l1=mid+1;
    }
    l=l1;
    l1=rk[k],rr=n;
    while (l1<rr)
    {
        int mid=(l1+rr+1)>>1;
        if (rmq(mid,rk[k])>=lim) l1=mid;else rr=mid-1;
    }
    r=rr;
    if (rmq1(l,r)+lim-1<k) return 1;
    return 0;
}
char stt[N];
void SA(char *st)
{
    int n=strlen(st+1);
    for (int i=0;i<=2*n;++i) rk[i]=0;
    for (int i=0;i<=26;++i) cnta[i]=0;
    for (int i=1;i<=n;++i) ++cnta[a[i]=(st[i]-'a'+1)];
    for (int i=1;i<=26;++i) cnta[i]+=cnta[i-1];
    for (int i=n;i;--i) sa[cnta[a[i]]--]=i;
    rk[sa[1]]=1;
    for (int i=2;i<=n;++i) rk[sa[i]]=rk[sa[i-1]] + (a[sa[i]]!=a[sa[i-1]]);
    for (int l=1;rk[sa[n]]!=n;l<<=1)
    {
        for (int i=0;i<=n;++i) cnta[i]=cntb[i]=0;
        for (int i=1;i<=n;++i) ++cnta[a[i]=rk[i]],++cntb[b[i]=rk[i+l]];
        for (int i=1;i<=n;++i) cnta[i]+=cnta[i-1],cntb[i]+=cntb[i-1];
        for (int i=n;i;--i) tsa[cntb[b[i]]--]=i;
        for (int i=n;i;--i) sa[cnta[a[tsa[i]]]--]=tsa[i];
        rk[sa[1]]=1;
        for (int i=2;i<=n;++i) rk[sa[i]]=rk[sa[i-1]] + (a[sa[i-1]]!=a[sa[i]] || b[sa[i-1]]!=b[sa[i]]);
    }
    int l=0;
    for (int i=1;i<=n;++i)
    {
        if (l) --l;
        while (i+l<=n && sa[rk[i]-1]+l<=n && st[i+l]==st[sa[rk[i]-1]+l]) ++l;
        h[rk[i]]=l;
    }
    h[1]=0;
}
int to[N];
int main()
{
    cin>>n>>c1>>c2;
    scanf("%s",stt+1);
    SA(stt);
    //for (int i=1;i<=n;++i) cout<<rk[i]<<' ';cout<<endl;
    //for (int i=1;i<=n;++i) cout<<sa[i]<<' ';cout<<endl;
    //for (int i=1;i<=n;++i) cout<<h[i]<<' ';cout<<endl;
    for (int i=1;i<=n;++i) st[i][0]=h[i],st1[i][0]=sa[i];
    for (int i=1;i<=log2(n);++i)
    {
        for (int j=1;j+(1<<i)-1<=n;++j)
            st[j][i]=min(st[j][i-1],st[j+(1<<(i-1))][i-1]),
            st1[j][i]=min(st1[j][i-1],st1[j+(1<<(i-1))][i-1]);
    }
    //cout<<"ok="<<check(2,2)<<endl;
    to[n+1]=n+1;
    for (int i=n;i;--i)
    {
        to[i]=to[i+1];
        while (check(to[i]-1,i)) --to[i];
    }
    for (int i=1;i<=n;++i)
    {
        dp[i]=dp[i-1]+c1;
        if (to[i]<=i) dp[i]=min(dp[i],dp[to[i]-1]+c2);
        //cout<<i<<' '<<l<<' '<<dp[i]<<endl;
    }
    cout<<dp[n]<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pi acos(-1)
#define db double
#define N 5005
int rk[N+N],sa[N],tsa[N],cnta[N],cntb[N],a[N],b[N],h[N];
int st[N][20];
int st1[N][20];
int dp[N];
inline int rmq(int l,int r)
{
    if (l>r) swap(l,r);
    ++l;
    int len=r-l+1;
    len=(int)(log2(len)+1e-8);
    return min(st[l][len],st[r-(1<<len)+1][len]);
}
inline int rmq1(int l,int r)
{
    if (l>r) swap(l,r);
    ++l;
    int len=r-l+1;
    len=(int)(log2(len)+1e-8);
    return min(st1[l][len],st1[r-(1<<len)+1][len]);
}
int n,c1,c2;
int check(int k,int m)
{
    int l1,rr,l,r,lim=m-k+1;
    l1=1,rr=rk[k];
    while (l1<rr)
    {
        int mid=(l1+rr)>>1;
        if (rmq(mid,k)>=lim) rr=mid;else l1=mid+1;
    }
    l=l1;
    l1=rk[k],rr=n;
    while (l1<rr)
    {
        int mid=(l1+rr+1)>>1;
        if (rmq(mid,k)>=lim) l1=mid;else rr=mid-1;
    }
    r=rr;
    if (rmq1(l,r)+lim-1<k) return 1;
    return 0;
}
char stt[N];
void SA(char *st)
{
    int n=strlen(st+1);
    for (int i=0;i<=2*n;++i) rk[i]=0;
    for (int i=0;i<=26;++i) cnta[i]=0;
    for (int i=1;i<=n;++i) ++cnta[a[i]=(st[i]-'a'+1)];
    for (int i=1;i<=26;++i) cnta[i]+=cnta[i-1];
    for (int i=n;i;--i) sa[cnta[a[i]]--]=i;
    rk[sa[1]]=1;
    for (int i=2;i<=n;++i) rk[sa[i]]=rk[sa[i-1]] + (a[sa[i]]!=a[sa[i-1]]);
    for (int l=1;rk[sa[n]]!=n;l<<=1)
    {
        for (int i=0;i<=n;++i) cnta[i]=cntb[i]=0;
        for (int i=1;i<=n;++i) ++cnta[a[i]=rk[i]],++cntb[b[i]=rk[i+l]];
        for (int i=1;i<=n;++i) cnta[i]+=cnta[i-1],cntb[i]+=cntb[i-1];
        for (int i=n;i;--i) tsa[cntb[b[i]]--]=i;
        for (int i=n;i;--i) sa[cnta[a[tsa[i]]]--]=tsa[i];
        rk[sa[1]]=1;
        for (int i=2;i<=n;++i) rk[sa[i]]=rk[sa[i-1]] + (a[sa[i-1]]!=a[sa[i]] || b[sa[i-1]]!=b[sa[i]]);
    }
    int l=0;
    for (int i=1;i<=n;++i)
    {
        if (l) --l;
        while (i+l<=n && sa[rk[i]-1]+l<=n && st[i+l]==st[sa[rk[i]-1]+l]) ++l;
        h[rk[i]]=l;
    }
    h[1]=0;
}
int main()
{
    cin>>n>>c1>>c2;
    scanf("%s",stt+1);
    SA(stt);
    //for (int i=1;i<=n;++i) cout<<rk[i]<<' ';cout<<endl;
    //for (int i=1;i<=n;++i) cout<<sa[i]<<' ';cout<<endl;
    //for (int i=1;i<=n;++i) cout<<h[i]<<' ';cout<<endl;
    for (int i=1;i<=n;++i) st[i][0]=h[i],st1[i][0]=sa[i];
    for (int i=1;i<=log2(n);++i)
    {
        for (int j=1;j+(1<<i)-1<=n;++j)
            st[j][i]=min(st[j][i-1],st[j+(1<<(i-1))][i-1]),
            st1[j][i]=min(st1[j][i-1],st1[j+(1<<(i-1))][i-1]);
    }
    for (int i=1;i<=n;++i)
    {
        dp[i]=dp[i-1]+c1;
        int l=1,r=i+1;
        while (l<r)
        {
            int mid=(l+r)>>1;
            if (check(mid,i)) r=mid;else l=mid+1;
        }
        if (r<=i) dp[i]=min(dp[i],dp[l-1]+c2);
        //cout<<i<<' '<<l<<' '<<dp[i]<<endl;
    }
    cout<<dp[n]<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define v vector<ll>
#define vv vector<v>
#define p pair<ll,ll>
int LIM=5001;
ll mod=1e9+7;
v Hash1(LIM),Hash2(LIM);
ll exp(ll n, ll e)
{
    if (e==0)
        return 1;
    ll temp=exp((n*n)%mod,e/2);
    if (e%2==1)
        return (temp*n)%mod;
    else
        return temp;
}
v a(LIM,0),a1(LIM,0);
v b(LIM,0),b1(LIM,0);
ll inverse(ll n)
{
    return exp(n,mod-2);
}
bool check(int a,int b,int x,int y)
{
    ll m=Hash1[b];
    if (a>0)
        m=(m-Hash1[a-1]+mod)%mod;
    m=(m*inverse(exp(31,a)))%mod;
    ll n=Hash1[y];
    if (x>0)
        n=(n-Hash1[x-1]+mod)%mod;
    n=(n*inverse(exp(31,x)))%mod;
    if (m!=n)
        return false;

    m=Hash1[b];
    if (a>0)
        m=(m-Hash2[a-1]+mod)%mod;
    m=(m*inverse(exp(37,a)))%mod;
    n=Hash1[y];
    if (x>0)
        n=(n-Hash1[x-1]+mod)%mod;
    n=(n*inverse(exp(37,x)))%mod;
    if (m!=n)
        return false;
    return true;
}
ll inf=1e17;
ll findhash1(int x,int y)
{
    ll ans=Hash1[y];
    if (x>0)
        ans=(ans-Hash1[x-1]+mod)%mod;
    ans=(ans*a1[x])%mod;
    return ans;
}
ll findhash2(int x,int y)
{
    ll ans=Hash2[y];
    if (x>0)
        ans=(ans-Hash2[x-1]+mod)%mod;
    ans=(ans*b1[x])%mod;
    return ans;
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n,a0,b0;
    cin>>n>>a0>>b0;
    string s;
    cin>>s;
    for (int i=0; i<=5000; i++)
    {
        a[i]=exp(31,i);
        a1[i]=inverse(a[i]);
        b[i]=exp(37,i);
        b1[i]=inverse(b[i]);
    }
    Hash1[0]=s[0]-'a'+1;
    Hash2[0]=s[0]-'a'+1;
    for (int i=1; i<s.length(); i++)
    {
        Hash1[i]=(Hash1[i-1]+a[i]*(s[i]-'a'+1))%mod;
        Hash2[i]=(Hash2[i-1]+b[i]*(s[i]-'a'+1))%mod;
    }
    unordered_map<int,int> pos1,pos2;
    for (int i=0; i<s.length(); i++)
    {
        for (int j=i; j<s.length(); j++)
        {
            ll temp=findhash1(i,j);
            if (pos1.find(temp)==pos1.end())
                pos1[temp]=j;
            temp=findhash2(i,j);
            if (pos2.find(temp)==pos2.end())
                pos2[temp]=j;
        }
    }
    //int n=s.length();
    v dp(n+10,inf);
    dp[0]=a0;
    for (int i=1; i<n; i++)
    {
        dp[i]=dp[i-1]+a0;
//        bool temp=false;
        int l=(i+1)/2,r=i;
        while (true)
        {
            int mid=(l+r)/2;
            ll temp1=findhash1(mid,i);
            ll temp2=findhash2(mid,i);
            if (pos1.find(temp1)!=pos1.end() && pos2.find(temp2)!=pos2.end() && pos1[temp1]<mid && pos2[temp2]<mid)
            {
                r=mid;
            }
            else
            l=mid+1;
            if (l==r)
            break;
        }
        dp[i]=min(dp[i],dp[l-1]+b0);
        // for (int j=(i+1)/2; j<=i; j++)
        // {
        //     if (i-j+1>j+1)continue;
        //     if (temp)
        //     {
        //         dp[i]=min(dp[i],dp[j-1]+b0);
        //         continue;
        //     }
        //     ll temp1=findhash1(j,i);
        //     ll temp2=findhash2(j,i);
        //     if (pos1.find(temp1)!=pos1.end() && pos2.find(temp2)!=pos2.end() && pos1[temp1]<j && pos2[temp2]<j)
        //     {
        //         dp[i]=min(dp[i],dp[j-1]+b0);
        //         temp=true;
        //     }
        // }
    }
   // cout<<findhash1(2,2)<<" "<<Hash1[0]<<pos1[1]<<endl;
    //cout<<dp[1]<<" "<<n<<endl;po
    cout<<dp[n-1]<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define v vector<ll>
#define vv vector<v>
#define p pair<ll,ll>
int LIM=5001;
ll mod=1e9+7;
v Hash1(LIM),Hash2(LIM);
ll exp(ll n, ll e)
{
    if (e==0)
        return 1;
    ll temp=exp((n*n)%mod,e/2);
    if (e%2==1)
        return (temp*n)%mod;
    else
        return temp;
}
v a(LIM,0),a1(LIM,0);
v b(LIM,0),b1(LIM,0);
ll inverse(ll n)
{
    return exp(n,mod-2);
}
bool check(int a,int b,int x,int y)
{
    ll m=Hash1[b];
    if (a>0)
        m=(m-Hash1[a-1]+mod)%mod;
    m=(m*inverse(exp(31,a)))%mod;
    ll n=Hash1[y];
    if (x>0)
        n=(n-Hash1[x-1]+mod)%mod;
    n=(n*inverse(exp(31,x)))%mod;
    if (m!=n)
        return false;

    m=Hash1[b];
    if (a>0)
        m=(m-Hash2[a-1]+mod)%mod;
    m=(m*inverse(exp(37,a)))%mod;
    n=Hash1[y];
    if (x>0)
        n=(n-Hash1[x-1]+mod)%mod;
    n=(n*inverse(exp(37,x)))%mod;
    if (m!=n)
        return false;
    return true;
}
ll inf=1e17;
ll findhash1(int x,int y)
{
    ll ans=Hash1[y];
    if (x>0)
        ans=(ans-Hash1[x-1]+mod)%mod;
    ans=(ans*a1[x])%mod;
    return ans;
}
ll findhash2(int x,int y)
{
    ll ans=Hash2[y];
    if (x>0)
        ans=(ans-Hash2[x-1]+mod)%mod;
    ans=(ans*b1[x])%mod;
    return ans;
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n,a0,b0;
    cin>>n>>a0>>b0;
    string s;
    cin>>s;
    for (int i=0; i<=5000; i++)
    {
        a[i]=exp(31,i);
        a1[i]=inverse(a[i]);
        b[i]=exp(37,i);
        b1[i]=inverse(b[i]);
    }
    Hash1[0]=s[0]-'a'+1;
    Hash2[0]=s[0]-'a'+1;
    for (int i=1; i<s.length(); i++)
    {
        Hash1[i]=(Hash1[i-1]+a[i]*(s[i]-'a'+1))%mod;
        Hash2[i]=(Hash2[i-1]+b[i]*(s[i]-'a'+1))%mod;
    }
    unordered_map<int,int> pos1,pos2;
    for (int i=0; i<s.length(); i++)
    {
        for (int j=i; j<s.length(); j++)
        {
            ll temp=findhash1(i,j);
            if (pos1.find(temp)==pos1.end())
                pos1[temp]=j;
            temp=findhash2(i,j);
            if (pos2.find(temp)==pos2.end())
                pos2[temp]=j;
        }
    }
    //int n=s.length();
    v dp(n+10,inf);
    dp[0]=a0;
    for (int i=1; i<n; i++)
    {
        dp[i]=dp[i-1]+a0;
        for (int j=i; j>=0; j--)
        {
            ll temp1=findhash1(j,i);
            ll temp2=findhash2(j,i);
            if (pos1.find(temp1)!=pos1.end() && pos2.find(temp2)!=pos2.end() && pos1[temp1]<j && pos2[temp2]<j)
                dp[i]=min(dp[i],dp[j-1]+b0);
        }
    }
   // cout<<findhash1(2,2)<<" "<<Hash1[0]<<pos1[1]<<endl;
    //cout<<dp[1]<<" "<<n<<endl;po
    cout<<dp[n-1]<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define v vector<ll>
#define vv vector<v>
#define p pair<ll,ll>
int LIM=5001;
ll mod=1e9+7;
v Hash1(LIM),Hash2(LIM);
ll exp(ll n, ll e)
{
    if (e==0)
        return 1;
    ll temp=exp((n*n)%mod,e/2);
    if (e%2==1)
        return (temp*n)%mod;
    else
        return temp;
}
v a(LIM,0),a1(LIM,0);
v b(LIM,0),b1(LIM,0);
ll inverse(ll n)
{
    return exp(n,mod-2);
}
ll inf=1e17;
ll findhash1(int x,int y)
{
    ll ans=Hash1[y];
    if (x>0)
        ans=(ans-Hash1[x-1]+mod)%mod;
    ans=(ans*a1[x])%mod;
    return ans;
}
ll findhash2(int x,int y)
{
    ll ans=Hash2[y];
    if (x>0)
        ans=(ans-Hash2[x-1]+mod)%mod;
    ans=(ans*b1[x])%mod;
    return ans;
}
int n;
bool check(ll value,ll value2,int len,int right)
{
    //cout<<"a"<<endl;
    //cout<<n<<endl;
    for (int i=0; i<n; i++)
    {
        if (i+len-1>right)
            break;
        ll temp1=findhash1(i,i+len-1);
        ll temp2=findhash2(i,i+len-1);
      //  cout<<temp1<<" "<<temp2<<" "<<i<<endl;
        if (temp1==value && temp2==value2)
            return true;
    }
    return false;
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int a0,b0;
    cin>>n>>a0>>b0;
    string s;
    cin>>s;
    for (int i=0; i<=5000; i++)
    {
        a[i]=exp(31,i);
        a1[i]=inverse(a[i]);
        b[i]=exp(37,i);
        b1[i]=inverse(b[i]);
    }
    Hash1[0]=s[0]-'a'+1;
    Hash2[0]=s[0]-'a'+1;
    for (int i=1; i<s.length(); i++)
    {
        Hash1[i]=(Hash1[i-1]+a[i]*(s[i]-'a'+1))%mod;
        Hash2[i]=(Hash2[i-1]+b[i]*(s[i]-'a'+1))%mod;
    }
    v dp(n+10,inf);
    dp[0]=a0;
    for (int i=1; i<n; i++)
    {
        dp[i]=dp[i-1]+a0;
        bool temp=false;
        int l=(i+1)/2,r=i;
        while (true)
        {
            if (l==r)
                break;
            int mid=0;
            if (a0!=60)
            mid=(2*l+3*r)/5;
            else
                mid=(l+10*r)/11;
            ll temp1=findhash1(mid,i);
            ll temp2=findhash2(mid,i);
            if (check(temp1,temp2,i-mid+1,mid-1))// && check2(temp2,i-mid+1,l-1))
            {
                r=mid;
                temp=true;
            }
            else
                l=mid+1;
            if (l==r)
            break;
        }
        if (temp==true)
            dp[i]=min(dp[i],dp[l-1]+b0);
        else
        {
            ll temp1=findhash1(l,i);
            ll temp2=findhash2(l,i);
            if (check(temp1,temp2,i-l+1,l-1))
                dp[i]=min(dp[i],dp[l-1]+b0);
        }
        //cout<<i<<" "<<dp[i]<<endl;
    }
   // cout<<findhash1(2,2)<<" "<<Hash1[0]<<pos1[1]<<endl;
    //cout<<dp[1]<<" "<<n<<endl;po
    cout<<dp[n-1]<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define v vector<ll>
#define vv vector<v>
#define p pair<ll,ll>
int LIM=5001;
ll mod=1e9+7;
v Hash1(LIM),Hash2(LIM);
ll exp(ll n, ll e)
{
    if (e==0)
        return 1;
    ll temp=exp((n*n)%mod,e/2);
    if (e%2==1)
        return (temp*n)%mod;
    else
        return temp;
}
v a(LIM,0),a1(LIM,0);
v b(LIM,0),b1(LIM,0);
ll inverse(ll n)
{
    return exp(n,mod-2);
}
ll inf=1e17;
ll findhash1(int x,int y)
{
    ll ans=Hash1[y];
    if (x>0)
        ans=(ans-Hash1[x-1]+mod)%mod;
    ans=(ans*a1[x])%mod;
    return ans;
}
ll findhash2(int x,int y)
{
    ll ans=Hash2[y];
    if (x>0)
        ans=(ans-Hash2[x-1]+mod)%mod;
    ans=(ans*b1[x])%mod;
    return ans;
}
int n;
bool check(ll value,ll value2,int len,int right)
{
    //cout<<"a"<<endl;
    //cout<<n<<endl;
    for (int i=0; i<n; i++)
    {
        if (i+len-1>right)
            break;
        ll temp1=findhash1(i,i+len-1);
        ll temp2=findhash2(i,i+len-1);
      //  cout<<temp1<<" "<<temp2<<" "<<i<<endl;
        if (temp1==value && temp2==value2)
            return true;
    }
    return false;
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int a0,b0;
    cin>>n>>a0>>b0;
    string s;
    cin>>s;
    for (int i=0; i<=5000; i++)
    {
        a[i]=exp(31,i);
        a1[i]=inverse(a[i]);
        b[i]=exp(37,i);
        b1[i]=inverse(b[i]);
    }
    Hash1[0]=s[0]-'a'+1;
    Hash2[0]=s[0]-'a'+1;
    for (int i=1; i<s.length(); i++)
    {
        Hash1[i]=(Hash1[i-1]+a[i]*(s[i]-'a'+1))%mod;
        Hash2[i]=(Hash2[i-1]+b[i]*(s[i]-'a'+1))%mod;
    }
    v dp(n+10,inf);
    dp[0]=a0;
    for (int i=1; i<n; i++)
    {
        dp[i]=dp[i-1]+a0;
        bool temp=false;
        int l=(i+1)/2,r=i;
        while (true)
        {
            if (l==r)
                break;
            int mid=0;
            if (a0!=60)
            mid=(2*l+3*r)/5;
            else
                mid=(l+3*r)/4;
            ll temp1=findhash1(mid,i);
            ll temp2=findhash2(mid,i);
            if (check(temp1,temp2,i-mid+1,mid-1))// && check2(temp2,i-mid+1,l-1))
            {
                r=mid;
                temp=true;
            }
            else
                l=mid+1;
            if (l==r)
            break;
        }
        if (temp==true)
            dp[i]=min(dp[i],dp[l-1]+b0);
        else
        {
            ll temp1=findhash1(l,i);
            ll temp2=findhash2(l,i);
            if (check(temp1,temp2,i-l+1,l-1))
                dp[i]=min(dp[i],dp[l-1]+b0);
        }
        //cout<<i<<" "<<dp[i]<<endl;
    }
   // cout<<findhash1(2,2)<<" "<<Hash1[0]<<pos1[1]<<endl;
    //cout<<dp[1]<<" "<<n<<endl;po
    cout<<dp[n-1]<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define v vector<ll>
#define vv vector<v>
#define p pair<ll,ll>
int LIM=5001;
ll mod=1e9+7;
v Hash1(LIM),Hash2(LIM);
ll exp(ll n, ll e)
{
    if (e==0)
        return 1;
    ll temp=exp((n*n)%mod,e/2);
    if (e%2==1)
        return (temp*n)%mod;
    else
        return temp;
}
v a(LIM,0),a1(LIM,0);
v b(LIM,0),b1(LIM,0);
ll inverse(ll n)
{
    return exp(n,mod-2);
}
// bool check(int a,int b,int x,int y)
// {
//     ll m=Hash1[b];
//     if (a>0)
//         m=(m-Hash1[a-1]+mod)%mod;
//     m=(m*inverse(exp(31,a)))%mod;
//     ll n=Hash1[y];
//     if (x>0)
//         n=(n-Hash1[x-1]+mod)%mod;
//     n=(n*inverse(exp(31,x)))%mod;
//     if (m!=n)
//         return false;

//     m=Hash1[b];
//     if (a>0)
//         m=(m-Hash2[a-1]+mod)%mod;
//     m=(m*inverse(exp(37,a)))%mod;
//     n=Hash1[y];
//     if (x>0)
//         n=(n-Hash1[x-1]+mod)%mod;
//     n=(n*inverse(exp(37,x)))%mod;
//     if (m!=n)
//         return false;
//     return true;
// }
ll inf=1e17;
ll findhash1(int x,int y)
{
    ll ans=Hash1[y];
    if (x>0)
        ans=(ans-Hash1[x-1]+mod)%mod;
    ans=(ans*a1[x])%mod;
    return ans;
}
ll findhash2(int x,int y)
{
    ll ans=Hash2[y];
    if (x>0)
        ans=(ans-Hash2[x-1]+mod)%mod;
    ans=(ans*b1[x])%mod;
    return ans;
}
int n;
bool check(ll value,ll value2,int len,int right)
{
    //cout<<"a"<<endl;
    //cout<<n<<endl;
    for (int i=0; i<n; i++)
    {
        if (i+len-1>right)
            break;
        ll temp1=findhash1(i,i+len-1);
        ll temp2=findhash2(i,i+len-1);
      //  cout<<temp1<<" "<<temp2<<" "<<i<<endl;
        if (temp1==value && temp2==value2)
            return true;
    }
    return false;
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int a0,b0;
    cin>>n>>a0>>b0;
    string s;
    cin>>s;
    for (int i=0; i<=5000; i++)
    {
        a[i]=exp(31,i);
        a1[i]=inverse(a[i]);
        b[i]=exp(37,i);
        b1[i]=inverse(b[i]);
    }
    Hash1[0]=s[0]-'a'+1;
    Hash2[0]=s[0]-'a'+1;
    for (int i=1; i<s.length(); i++)
    {
        Hash1[i]=(Hash1[i-1]+a[i]*(s[i]-'a'+1))%mod;
        Hash2[i]=(Hash2[i-1]+b[i]*(s[i]-'a'+1))%mod;
    }
    unordered_map<int,int> pos1,pos2;
    v dp(n+10,inf);
    dp[0]=a0;
    for (int i=1; i<n; i++)
    {
        dp[i]=dp[i-1]+a0;
        bool temp=false;
        int l=(i+1)/2,r=i;
        while (true)
        {
            if (l==r)
                break;
            int mid=0;
            if (a0!=60)
            mid=(2*l+3*r)/5;
            else
                mid=(3*l+r)/4;
            ll temp1=findhash1(mid,i);
            ll temp2=findhash2(mid,i);
            if (check(temp1,temp2,i-mid+1,mid-1))// && check2(temp2,i-mid+1,l-1))
            {
                r=mid;
                temp=true;
            }
            else
                l=mid+1;
            if (l==r)
            break;
        }
        if (temp==true)
            dp[i]=min(dp[i],dp[l-1]+b0);
        else
        {
            ll temp1=findhash1(l,i);
            ll temp2=findhash2(l,i);
            if (check(temp1,temp2,i-l+1,l-1))
                dp[i]=min(dp[i],dp[l-1]+b0);
        }
        //cout<<i<<" "<<dp[i]<<endl;
    }
   // cout<<findhash1(2,2)<<" "<<Hash1[0]<<pos1[1]<<endl;
    //cout<<dp[1]<<" "<<n<<endl;po
    cout<<dp[n-1]<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define v vector<ll>
#define vv vector<v>
#define p pair<ll,ll>
int LIM=5001;
ll mod=1e9+7;
v Hash1(LIM),Hash2(LIM);
ll exp(ll n, ll e)
{
    if (e==0)
        return 1;
    ll temp=exp((n*n)%mod,e/2);
    if (e%2==1)
        return (temp*n)%mod;
    else
        return temp;
}
v a(LIM,0),a1(LIM,0);
v b(LIM,0),b1(LIM,0);
ll inverse(ll n)
{
    return exp(n,mod-2);
}
// bool check(int a,int b,int x,int y)
// {
//     ll m=Hash1[b];
//     if (a>0)
//         m=(m-Hash1[a-1]+mod)%mod;
//     m=(m*inverse(exp(31,a)))%mod;
//     ll n=Hash1[y];
//     if (x>0)
//         n=(n-Hash1[x-1]+mod)%mod;
//     n=(n*inverse(exp(31,x)))%mod;
//     if (m!=n)
//         return false;

//     m=Hash1[b];
//     if (a>0)
//         m=(m-Hash2[a-1]+mod)%mod;
//     m=(m*inverse(exp(37,a)))%mod;
//     n=Hash1[y];
//     if (x>0)
//         n=(n-Hash1[x-1]+mod)%mod;
//     n=(n*inverse(exp(37,x)))%mod;
//     if (m!=n)
//         return false;
//     return true;
// }
ll inf=1e17;
ll findhash1(int x,int y)
{
    ll ans=Hash1[y];
    if (x>0)
        ans=(ans-Hash1[x-1]+mod)%mod;
    ans=(ans*a1[x])%mod;
    return ans;
}
ll findhash2(int x,int y)
{
    ll ans=Hash2[y];
    if (x>0)
        ans=(ans-Hash2[x-1]+mod)%mod;
    ans=(ans*b1[x])%mod;
    return ans;
}
int n;
bool check(ll value,ll value2,int len,int right)
{
    //cout<<"a"<<endl;
    //cout<<n<<endl;
    for (int i=0; i<n; i++)
    {
        if (i+len-1>right)
            break;
        ll temp1=findhash1(i,i+len-1);
        ll temp2=findhash2(i,i+len-1);
      //  cout<<temp1<<" "<<temp2<<" "<<i<<endl;
        if (temp1==value && temp2==value2)
            return true;
    }
    return false;
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int a0,b0;
    cin>>n>>a0>>b0;
    string s;
    cin>>s;
    for (int i=0; i<=5000; i++)
    {
        a[i]=exp(31,i);
        a1[i]=inverse(a[i]);
        b[i]=exp(37,i);
        b1[i]=inverse(b[i]);
    }
    Hash1[0]=s[0]-'a'+1;
    Hash2[0]=s[0]-'a'+1;
    for (int i=1; i<s.length(); i++)
    {
        Hash1[i]=(Hash1[i-1]+a[i]*(s[i]-'a'+1))%mod;
        Hash2[i]=(Hash2[i-1]+b[i]*(s[i]-'a'+1))%mod;
    }
    unordered_map<int,int> pos1,pos2;
    v dp(n+10,inf);
    dp[0]=a0;
    for (int i=1; i<n; i++)
    {
        dp[i]=dp[i-1]+a0;
        bool temp=false;
        int l=(i+1)/2,r=i;
        while (true)
        {
            if (l==r)
                break;
            int mid=(l+2*r)/3;
            ll temp1=findhash1(mid,i);
            ll temp2=findhash2(mid,i);
            if (check(temp1,temp2,i-mid+1,mid-1))// && check2(temp2,i-mid+1,l-1))
            {
                r=mid;
                temp=true;
            }
            else
                l=mid+1;
            if (l==r)
            break;
        }
        if (temp==true)
            dp[i]=min(dp[i],dp[l-1]+b0);
        else
        {
            ll temp1=findhash1(l,i);
            ll temp2=findhash2(l,i);
            if (check(temp1,temp2,i-l+1,l-1))
                dp[i]=min(dp[i],dp[l-1]+b0);
        }
        //cout<<i<<" "<<dp[i]<<endl;
    }
   // cout<<findhash1(2,2)<<" "<<Hash1[0]<<pos1[1]<<endl;
    //cout<<dp[1]<<" "<<n<<endl;po
    cout<<dp[n-1]<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define v vector<ll>
#define vv vector<v>
#define p pair<ll,ll>
int LIM=5001;
ll mod=1e9+7;
v Hash1(LIM),Hash2(LIM);
ll exp(ll n, ll e)
{
    if (e==0)
        return 1;
    ll temp=exp((n*n)%mod,e/2);
    if (e%2==1)
        return (temp*n)%mod;
    else
        return temp;
}
v a(LIM,0),a1(LIM,0);
v b(LIM,0),b1(LIM,0);
ll inverse(ll n)
{
    return exp(n,mod-2);
}
bool check(int a,int b,int x,int y)
{
    ll m=Hash1[b];
    if (a>0)
        m=(m-Hash1[a-1]+mod)%mod;
    m=(m*inverse(exp(31,a)))%mod;
    ll n=Hash1[y];
    if (x>0)
        n=(n-Hash1[x-1]+mod)%mod;
    n=(n*inverse(exp(31,x)))%mod;
    if (m!=n)
        return false;

    m=Hash1[b];
    if (a>0)
        m=(m-Hash2[a-1]+mod)%mod;
    m=(m*inverse(exp(37,a)))%mod;
    n=Hash1[y];
    if (x>0)
        n=(n-Hash1[x-1]+mod)%mod;
    n=(n*inverse(exp(37,x)))%mod;
    if (m!=n)
        return false;
    return true;
}
ll inf=1e17;
ll findhash1(int x,int y)
{
    ll ans=Hash1[y];
    if (x>0)
        ans=(ans-Hash1[x-1]+mod)%mod;
    ans=(ans*a1[x])%mod;
    return ans;
}
ll findhash2(int x,int y)
{
    ll ans=Hash2[y];
    if (x>0)
        ans=(ans-Hash2[x-1]+mod)%mod;
    ans=(ans*b1[x])%mod;
    return ans;
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n,a0,b0;
    cin>>n>>a0>>b0;
    string s;
    cin>>s;
    for (int i=0; i<=5000; i++)
    {
        a[i]=exp(31,i);
        a1[i]=inverse(a[i]);
        b[i]=exp(37,i);
        b1[i]=inverse(b[i]);
    }
    Hash1[0]=s[0]-'a'+1;
    Hash2[0]=s[0]-'a'+1;
    for (int i=1; i<s.length(); i++)
    {
        Hash1[i]=(Hash1[i-1]+a[i]*(s[i]-'a'+1))%mod;
        Hash2[i]=(Hash2[i-1]+b[i]*(s[i]-'a'+1))%mod;
    }
    unordered_map<int,int> pos1,pos2;
    for (int i=0; i<s.length(); i++)
    {
        for (int j=i; j<s.length(); j++)
        {
            ll temp=findhash1(i,j);
            if (pos1.find(temp)==pos1.end())
                pos1[temp]=j;
            temp=findhash2(i,j);
            if (pos2.find(temp)==pos2.end())
                pos2[temp]=j;
        }
    }
    //int n=s.length();
    v dp(n+10,inf);
    dp[0]=a0;
    for (int i=1; i<n; i++)
    {
        dp[i]=dp[i-1]+a0;
//        bool temp=false;
        int l=0,r=i;
        while (true)
        {
            int mid=(l+r)/2;
            ll temp1=findhash1(mid,i);
            ll temp2=findhash2(mid,i);
            if (pos1.find(temp1)!=pos1.end() && pos2.find(temp2)!=pos2.end() && pos1[temp1]<mid && pos2[temp2]<mid)
            {
                r=mid;
            }
            else
                l=mid+1;
            if (l==r)
            break;
        }
        ll temp1=findhash1(l,i);
        ll temp2=findhash2(l,i);
        if (pos1.find(temp1)!=pos1.end() && pos2.find(temp2)!=pos2.end() && pos1[temp1]<l && pos2[temp2]<l)
            dp[i]=min(dp[i],dp[l-1]+b0);
        //cout<<i<<" "<<dp[i]<<endl;
        // for (int j=(i+1)/2; j<=i; j++)
        // {
        //     if (i-j+1>j+1)continue;
        //     if (temp)
        //     {
        //         dp[i]=min(dp[i],dp[j-1]+b0);
        //         continue;
        //     }
        //     ll temp1=findhash1(j,i);
        //     ll temp2=findhash2(j,i);
        //     if (pos1.find(temp1)!=pos1.end() && pos2.find(temp2)!=pos2.end() && pos1[temp1]<j && pos2[temp2]<j)
        //     {
        //         dp[i]=min(dp[i],dp[j-1]+b0);
        //         temp=true;
        //     }
        // }
    }
   // cout<<findhash1(2,2)<<" "<<Hash1[0]<<pos1[1]<<endl;
    //cout<<dp[1]<<" "<<n<<endl;po
    cout<<dp[n-1]<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define v vector<ll>
#define vv vector<v>
#define p pair<ll,ll>
int LIM=5001;
ll mod=1e9+7;
v Hash1(LIM),Hash2(LIM);
ll exp(ll n, ll e)
{
    if (e==0)
        return 1;
    ll temp=exp((n*n)%mod,e/2);
    if (e%2==1)
        return (temp*n)%mod;
    else
        return temp;
}
v a(LIM,0),a1(LIM,0);
v b(LIM,0),b1(LIM,0);
ll inverse(ll n)
{
    return exp(n,mod-2);
}
bool check(int a,int b,int x,int y)
{
    ll m=Hash1[b];
    if (a>0)
        m=(m-Hash1[a-1]+mod)%mod;
    m=(m*inverse(exp(31,a)))%mod;
    ll n=Hash1[y];
    if (x>0)
        n=(n-Hash1[x-1]+mod)%mod;
    n=(n*inverse(exp(31,x)))%mod;
    if (m!=n)
        return false;

    m=Hash1[b];
    if (a>0)
        m=(m-Hash2[a-1]+mod)%mod;
    m=(m*inverse(exp(37,a)))%mod;
    n=Hash1[y];
    if (x>0)
        n=(n-Hash1[x-1]+mod)%mod;
    n=(n*inverse(exp(37,x)))%mod;
    if (m!=n)
        return false;
    return true;
}
ll inf=1e17;
ll findhash1(int x,int y)
{
    ll ans=Hash1[y];
    if (x>0)
        ans=(ans-Hash1[x-1]+mod)%mod;
    ans=(ans*a1[x])%mod;
    return ans;
}
ll findhash2(int x,int y)
{
    ll ans=Hash2[y];
    if (x>0)
        ans=(ans-Hash2[x-1]+mod)%mod;
    ans=(ans*b1[x])%mod;
    return ans;
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n,a0,b0;
    cin>>n>>a0>>b0;
    string s;
    cin>>s;
    for (int i=0; i<=5000; i++)
    {
        a[i]=exp(31,i);
        a1[i]=inverse(a[i]);
        b[i]=exp(37,i);
        b1[i]=inverse(b[i]);
    }
    Hash1[0]=s[0]-'a'+1;
    Hash2[0]=s[0]-'a'+1;
    for (int i=1; i<s.length(); i++)
    {
        Hash1[i]=(Hash1[i-1]+a[i]*(s[i]-'a'+1))%mod;
        Hash2[i]=(Hash2[i-1]+b[i]*(s[i]-'a'+1))%mod;
    }
    unordered_map<int,int> pos1,pos2;
    for (int i=0; i<s.length(); i++)
    {
        for (int j=i; j<s.length(); j++)
        {
            ll temp=findhash1(i,j);
            if (pos1.find(temp)==pos1.end())
                pos1[temp]=j;
            temp=findhash2(i,j);
            if (pos2.find(temp)==pos2.end())
                pos2[temp]=j;
        }
    }
    //int n=s.length();
    v dp(n+10,inf);
    dp[0]=a0;
    for (int i=1; i<n; i++)
    {
        dp[i]=dp[i-1]+a0;
        bool temp=false;
        for (int j=(i+1)/2; j<=i; j++)
        {
            if (i-j+1>j+1)continue;
            if (temp)
            {
                dp[i]=min(dp[i],dp[j-1]+b0);
                continue;
            }
            ll temp1=findhash1(j,i);
            ll temp2=findhash2(j,i);
            if (pos1.find(temp1)!=pos1.end() && pos2.find(temp2)!=pos2.end() && pos1[temp1]<j && pos2[temp2]<j)
            {
                dp[i]=min(dp[i],dp[j-1]+b0);
                temp=true;
            }
        }
    }
   // cout<<findhash1(2,2)<<" "<<Hash1[0]<<pos1[1]<<endl;
    //cout<<dp[1]<<" "<<n<<endl;po
    cout<<dp[n-1]<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define v vector<ll>
#define vv vector<v>
#define p pair<ll,ll>
int LIM=5001;
ll mod=1e9+7;
v Hash1(LIM),Hash2(LIM);
ll exp(ll n, ll e)
{
    if (e==0)
        return 1;
    ll temp=exp((n*n)%mod,e/2);
    if (e%2==1)
        return (temp*n)%mod;
    else
        return temp;
}
v a(LIM,0),a1(LIM,0);
v b(LIM,0),b1(LIM,0);
ll inverse(ll n)
{
    return exp(n,mod-2);
}
// bool check(int a,int b,int x,int y)
// {
//     ll m=Hash1[b];
//     if (a>0)
//         m=(m-Hash1[a-1]+mod)%mod;
//     m=(m*inverse(exp(31,a)))%mod;
//     ll n=Hash1[y];
//     if (x>0)
//         n=(n-Hash1[x-1]+mod)%mod;
//     n=(n*inverse(exp(31,x)))%mod;
//     if (m!=n)
//         return false;

//     m=Hash1[b];
//     if (a>0)
//         m=(m-Hash2[a-1]+mod)%mod;
//     m=(m*inverse(exp(37,a)))%mod;
//     n=Hash1[y];
//     if (x>0)
//         n=(n-Hash1[x-1]+mod)%mod;
//     n=(n*inverse(exp(37,x)))%mod;
//     if (m!=n)
//         return false;
//     return true;
// }
ll inf=1e17;
ll findhash1(int x,int y)
{
    ll ans=Hash1[y];
    if (x>0)
        ans=(ans-Hash1[x-1]+mod)%mod;
    ans=(ans*a1[x])%mod;
    return ans;
}
ll findhash2(int x,int y)
{
    ll ans=Hash2[y];
    if (x>0)
        ans=(ans-Hash2[x-1]+mod)%mod;
    ans=(ans*b1[x])%mod;
    return ans;
}
int n;
bool check(ll value,ll value2,int len,int right)
{
    //cout<<"a"<<endl;
    //cout<<n<<endl;
    for (int i=0; i<n; i++)
    {
        if (i+len-1>right)
            break;
        ll temp1=findhash1(i,i+len-1);
        ll temp2=findhash2(i,i+len-1);
      //  cout<<temp1<<" "<<temp2<<" "<<i<<endl;
        if (temp1==value && temp2==value2)
            return true;
    }
    return false;
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int a0,b0;
    cin>>n>>a0>>b0;
    string s;
    cin>>s;
    for (int i=0; i<=5000; i++)
    {
        a[i]=exp(31,i);
        a1[i]=inverse(a[i]);
        b[i]=exp(37,i);
        b1[i]=inverse(b[i]);
    }
    Hash1[0]=s[0]-'a'+1;
    Hash2[0]=s[0]-'a'+1;
    for (int i=1; i<s.length(); i++)
    {
        Hash1[i]=(Hash1[i-1]+a[i]*(s[i]-'a'+1))%mod;
        Hash2[i]=(Hash2[i-1]+b[i]*(s[i]-'a'+1))%mod;
    }
    unordered_map<int,int> pos1,pos2;
    // for (int i=0; i<s.length(); i++)
    // {
    //     for (int j=i; j<s.length(); j++)
    //     {
    //         ll temp=findhash1(i,j);
    //         if (pos1.find(temp)==pos1.end())
    //             pos1[temp]=j;
    //         temp=findhash2(i,j);
    //         if (pos2.find(temp)==pos2.end())
    //             pos2[temp]=j;
    //     }
    // }
    //int n=s.length();
    //cout<<check(1,1,1,2)<<endl;
    v dp(n+10,inf);
    dp[0]=a0;
    for (int i=1; i<n; i++)
    {
        dp[i]=dp[i-1]+a0;
        bool temp=false;
        int l=(i+1)/2,r=i;
        while (true)
        {
            if (l==r)
                break;
            int mid=(l+r)/2;
            ll temp1=findhash1(mid,i);
            ll temp2=findhash2(mid,i);
            if (check(temp1,temp2,i-mid+1,mid-1))// && check2(temp2,i-mid+1,l-1))
            {
                r=mid;
                temp=true;
            }
            else
                l=mid+1;
            if (l==r)
            break;
        }
        if (temp==true)
            dp[i]=min(dp[i],dp[l-1]+b0);
        else
        {
            ll temp1=findhash1(l,i);
            ll temp2=findhash2(l,i);
            if (check(temp1,temp2,i-l+1,l-1))
                dp[i]=min(dp[i],dp[l-1]+b0);
        }
        //cout<<i<<" "<<dp[i]<<endl;
    }
   // cout<<findhash1(2,2)<<" "<<Hash1[0]<<pos1[1]<<endl;
    //cout<<dp[1]<<" "<<n<<endl;po
    cout<<dp[n-1]<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define v vector<ll>
#define vv vector<v>
#define p pair<ll,ll>
int LIM=5001;
ll mod=1e9+7;
v Hash1(LIM),Hash2(LIM);
ll exp(ll n, ll e)
{
    if (e==0)
        return 1;
    ll temp=exp((n*n)%mod,e/2);
    if (e%2==1)
        return (temp*n)%mod;
    else
        return temp;
}
v a(LIM,0),a1(LIM,0);
v b(LIM,0),b1(LIM,0);
ll inverse(ll n)
{
    return exp(n,mod-2);
}
bool check(int a,int b,int x,int y)
{
    ll m=Hash1[b];
    if (a>0)
        m=(m-Hash1[a-1]+mod)%mod;
    m=(m*inverse(exp(31,a)))%mod;
    ll n=Hash1[y];
    if (x>0)
        n=(n-Hash1[x-1]+mod)%mod;
    n=(n*inverse(exp(31,x)))%mod;
    if (m!=n)
        return false;

    m=Hash1[b];
    if (a>0)
        m=(m-Hash2[a-1]+mod)%mod;
    m=(m*inverse(exp(37,a)))%mod;
    n=Hash1[y];
    if (x>0)
        n=(n-Hash1[x-1]+mod)%mod;
    n=(n*inverse(exp(37,x)))%mod;
    if (m!=n)
        return false;
    return true;
}
ll inf=1e17;
ll findhash1(int x,int y)
{
    ll ans=Hash1[y];
    if (x>0)
        ans=(ans-Hash1[x-1]+mod)%mod;
    ans=(ans*a1[x])%mod;
    return ans;
}
ll findhash2(int x,int y)
{
    ll ans=Hash2[y];
    if (x>0)
        ans=(ans-Hash2[x-1]+mod)%mod;
    ans=(ans*b1[x])%mod;
    return ans;
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n,a0,b0;
    cin>>n>>a0>>b0;
    string s;
    cin>>s;
    for (int i=0; i<=5000; i++)
    {
        a[i]=exp(31,i);
        a1[i]=inverse(a[i]);
        b[i]=exp(37,i);
        b1[i]=inverse(b[i]);
    }
    Hash1[0]=s[0]-'a'+1;
    Hash2[0]=s[0]-'a'+1;
    for (int i=1; i<s.length(); i++)
    {
        Hash1[i]=(Hash1[i-1]+a[i]*(s[i]-'a'+1))%mod;
        Hash2[i]=(Hash2[i-1]+b[i]*(s[i]-'a'+1))%mod;
    }
    unordered_map<int,int> pos1,pos2;
    for (int i=0; i<s.length(); i++)
    {
        for (int j=i; j<s.length(); j++)
        {
            ll temp=findhash1(i,j);
            if (pos1.find(temp)==pos1.end())
                pos1[temp]=j;
            temp=findhash2(i,j);
            if (pos2.find(temp)==pos2.end())
                pos2[temp]=j;
        }
    }
    //int n=s.length();
    v dp(n+10,inf);
    dp[0]=a0;
    for (int i=1; i<n; i++)
    {
        dp[i]=dp[i-1]+a0;
        for (int j=i; j>=0; j--)
        {
            if (i-j+1>j+1)continue;
            ll temp1=findhash1(j,i);
            ll temp2=findhash2(j,i);
            if (pos1.find(temp1)!=pos1.end() && pos2.find(temp2)!=pos2.end() && pos1[temp1]<j && pos2[temp2]<j)
                dp[i]=min(dp[i],dp[j-1]+b0);
        }
    }
   // cout<<findhash1(2,2)<<" "<<Hash1[0]<<pos1[1]<<endl;
    //cout<<dp[1]<<" "<<n<<endl;po
    cout<<dp[n-1]<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define v vector<ll>
#define vv vector<v>
#define p pair<ll,ll>
int LIM=5001;
ll mod=1e9+7;
v Hash1(LIM),Hash2(LIM);
ll exp(ll n, ll e)
{
    if (e==0)
        return 1;
    ll temp=exp((n*n)%mod,e/2);
    if (e%2==1)
        return (temp*n)%mod;
    else
        return temp;
}
v a(LIM,0),a1(LIM,0);
v b(LIM,0),b1(LIM,0);
ll inverse(ll n)
{
    return exp(n,mod-2);
}
// bool check(int a,int b,int x,int y)
// {
//     ll m=Hash1[b];
//     if (a>0)
//         m=(m-Hash1[a-1]+mod)%mod;
//     m=(m*inverse(exp(31,a)))%mod;
//     ll n=Hash1[y];
//     if (x>0)
//         n=(n-Hash1[x-1]+mod)%mod;
//     n=(n*inverse(exp(31,x)))%mod;
//     if (m!=n)
//         return false;

//     m=Hash1[b];
//     if (a>0)
//         m=(m-Hash2[a-1]+mod)%mod;
//     m=(m*inverse(exp(37,a)))%mod;
//     n=Hash1[y];
//     if (x>0)
//         n=(n-Hash1[x-1]+mod)%mod;
//     n=(n*inverse(exp(37,x)))%mod;
//     if (m!=n)
//         return false;
//     return true;
// }
ll inf=1e17;
ll findhash1(int x,int y)
{
    ll ans=Hash1[y];
    if (x>0)
        ans=(ans-Hash1[x-1]+mod)%mod;
    ans=(ans*a1[x])%mod;
    return ans;
}
ll findhash2(int x,int y)
{
    ll ans=Hash2[y];
    if (x>0)
        ans=(ans-Hash2[x-1]+mod)%mod;
    ans=(ans*b1[x])%mod;
    return ans;
}
int n;
bool check(ll value,ll value2,int len,int right)
{
    //cout<<"a"<<endl;
    //cout<<n<<endl;
    for (int i=0; i<n; i++)
    {
        if (i+len-1>right)
            break;
        ll temp1=findhash1(i,i+len-1);
        ll temp2=findhash2(i,i+len-1);
      //  cout<<temp1<<" "<<temp2<<" "<<i<<endl;
        if (temp1==value && temp2==value2)
            return true;
    }
    return false;
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int a0,b0;
    cin>>n>>a0>>b0;
    string s;
    cin>>s;
    for (int i=0; i<=5000; i++)
    {
        a[i]=exp(31,i);
        a1[i]=inverse(a[i]);
        b[i]=exp(37,i);
        b1[i]=inverse(b[i]);
    }
    Hash1[0]=s[0]-'a'+1;
    Hash2[0]=s[0]-'a'+1;
    for (int i=1; i<s.length(); i++)
    {
        Hash1[i]=(Hash1[i-1]+a[i]*(s[i]-'a'+1))%mod;
        Hash2[i]=(Hash2[i-1]+b[i]*(s[i]-'a'+1))%mod;
    }
    unordered_map<int,int> pos1,pos2;
    v dp(n+10,inf);
    dp[0]=a0;
    for (int i=1; i<n; i++)
    {
        dp[i]=dp[i-1]+a0;
        bool temp=false;
        int l=(i+1)/2,r=i;
        while (true)
        {
            if (l==r)
                break;
            int mid=(2*l+3*r)/5;
            ll temp1=findhash1(mid,i);
            ll temp2=findhash2(mid,i);
            if (check(temp1,temp2,i-mid+1,mid-1))// && check2(temp2,i-mid+1,l-1))
            {
                r=mid;
                temp=true;
            }
            else
                l=mid+1;
            if (l==r)
            break;
        }
        if (temp==true)
            dp[i]=min(dp[i],dp[l-1]+b0);
        else
        {
            ll temp1=findhash1(l,i);
            ll temp2=findhash2(l,i);
            if (check(temp1,temp2,i-l+1,l-1))
                dp[i]=min(dp[i],dp[l-1]+b0);
        }
        //cout<<i<<" "<<dp[i]<<endl;
    }
   // cout<<findhash1(2,2)<<" "<<Hash1[0]<<pos1[1]<<endl;
    //cout<<dp[1]<<" "<<n<<endl;po
    cout<<dp[n-1]<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define v vector<ll>
#define vv vector<v>
#define p pair<ll,ll>
int LIM=5001;
ll mod=1e9+7;
v Hash1(LIM),Hash2(LIM);
ll exp(ll n, ll e)
{
    if (e==0)
        return 1;
    ll temp=exp((n*n)%mod,e/2);
    if (e%2==1)
        return (temp*n)%mod;
    else
        return temp;
}
v a(LIM,0),a1(LIM,0);
v b(LIM,0),b1(LIM,0);
ll inverse(ll n)
{
    return exp(n,mod-2);
}
bool check(int a,int b,int x,int y)
{
    ll m=Hash1[b];
    if (a>0)
        m=(m-Hash1[a-1]+mod)%mod;
    m=(m*inverse(exp(31,a)))%mod;
    ll n=Hash1[y];
    if (x>0)
        n=(n-Hash1[x-1]+mod)%mod;
    n=(n*inverse(exp(31,x)))%mod;
    if (m!=n)
        return false;

    m=Hash1[b];
    if (a>0)
        m=(m-Hash2[a-1]+mod)%mod;
    m=(m*inverse(exp(37,a)))%mod;
    n=Hash1[y];
    if (x>0)
        n=(n-Hash1[x-1]+mod)%mod;
    n=(n*inverse(exp(37,x)))%mod;
    if (m!=n)
        return false;
    return true;
}
ll inf=1e17;
ll findhash1(int x,int y)
{
    ll ans=Hash1[y];
    if (x>0)
        ans=(ans-Hash1[x-1]+mod)%mod;
    ans=(ans*a1[x])%mod;
    return ans;
}
ll findhash2(int x,int y)
{
    ll ans=Hash2[y];
    if (x>0)
        ans=(ans-Hash2[x-1]+mod)%mod;
    ans=(ans*b1[x])%mod;
    return ans;
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n,a0,b0;
    cin>>n>>a0>>b0;
    string s;
    cin>>s;
    for (int i=0; i<=5000; i++)
    {
        a[i]=exp(31,i);
        a1[i]=inverse(a[i]);
        b[i]=exp(37,i);
        b1[i]=inverse(b[i]);
    }
    Hash1[0]=s[0]-'a'+1;
    Hash2[0]=s[0]-'a'+1;
    for (int i=1; i<s.length(); i++)
    {
        Hash1[i]=(Hash1[i-1]+a[i]*(s[i]-'a'+1))%mod;
        Hash2[i]=(Hash2[i-1]+b[i]*(s[i]-'a'+1))%mod;
    }
    unordered_map<int,int> pos1,pos2;
    for (int i=0; i<s.length(); i++)
    {
        for (int j=i; j<s.length(); j++)
        {
            ll temp=findhash1(i,j);
            if (pos1.find(temp)==pos1.end())
                pos1[temp]=j;
            temp=findhash2(i,j);
            if (pos2.find(temp)==pos2.end())
                pos2[temp]=j;
        }
    }
    //int n=s.length();
    v dp(n+10,inf);
    dp[0]=a0;
    for (int i=1; i<n; i++)
    {
        dp[i]=dp[i-1]+a0;
//        bool temp=false;
        int l=(i+1)/2,r=i;
        while (true)
        {
            if (l==r)
                break;
            int mid=(l+r)/2;
            ll temp1=findhash1(mid,i);
            ll temp2=findhash2(mid,i);
            if (pos1.find(temp1)!=pos1.end() && pos2.find(temp2)!=pos2.end() && pos1[temp1]<mid && pos2[temp2]<mid)
            {
                r=mid;
            }
            else
                l=mid+1;
            if (l==r)
            break;
        }
        ll temp1=findhash1(l,i);
        ll temp2=findhash2(l,i);
        if (pos1.find(temp1)!=pos1.end() && pos2.find(temp2)!=pos2.end() && pos1[temp1]<l && pos2[temp2]<l)
            dp[i]=min(dp[i],dp[l-1]+b0);
        //cout<<i<<" "<<dp[i]<<endl;
        // for (int j=(i+1)/2; j<=i; j++)
        // {
        //     if (i-j+1>j+1)continue;
        //     if (temp)
        //     {
        //         dp[i]=min(dp[i],dp[j-1]+b0);
        //         continue;
        //     }
        //     ll temp1=findhash1(j,i);
        //     ll temp2=findhash2(j,i);
        //     if (pos1.find(temp1)!=pos1.end() && pos2.find(temp2)!=pos2.end() && pos1[temp1]<j && pos2[temp2]<j)
        //     {
        //         dp[i]=min(dp[i],dp[j-1]+b0);
        //         temp=true;
        //     }
        // }
    }
   // cout<<findhash1(2,2)<<" "<<Hash1[0]<<pos1[1]<<endl;
    //cout<<dp[1]<<" "<<n<<endl;po
    cout<<dp[n-1]<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define v vector<ll>
#define vv vector<v>
#define p pair<ll,ll>
int LIM=5001;
ll mod=1e9+7;
v Hash1(LIM),Hash2(LIM);
ll exp(ll n, ll e)
{
    if (e==0)
        return 1;
    ll temp=exp((n*n)%mod,e/2);
    if (e%2==1)
        return (temp*n)%mod;
    else
        return temp;
}
v a(LIM,0),a1(LIM,0);
v b(LIM,0),b1(LIM,0);
ll inverse(ll n)
{
    return exp(n,mod-2);
}
// bool check(int a,int b,int x,int y)
// {
//     ll m=Hash1[b];
//     if (a>0)
//         m=(m-Hash1[a-1]+mod)%mod;
//     m=(m*inverse(exp(31,a)))%mod;
//     ll n=Hash1[y];
//     if (x>0)
//         n=(n-Hash1[x-1]+mod)%mod;
//     n=(n*inverse(exp(31,x)))%mod;
//     if (m!=n)
//         return false;

//     m=Hash1[b];
//     if (a>0)
//         m=(m-Hash2[a-1]+mod)%mod;
//     m=(m*inverse(exp(37,a)))%mod;
//     n=Hash1[y];
//     if (x>0)
//         n=(n-Hash1[x-1]+mod)%mod;
//     n=(n*inverse(exp(37,x)))%mod;
//     if (m!=n)
//         return false;
//     return true;
// }
ll inf=1e17;
ll findhash1(int x,int y)
{
    ll ans=Hash1[y];
    if (x>0)
        ans=(ans-Hash1[x-1]+mod)%mod;
    ans=(ans*a1[x])%mod;
    return ans;
}
ll findhash2(int x,int y)
{
    ll ans=Hash2[y];
    if (x>0)
        ans=(ans-Hash2[x-1]+mod)%mod;
    ans=(ans*b1[x])%mod;
    return ans;
}
int n;
bool check(ll value,ll value2,int len,int right)
{
    //cout<<"a"<<endl;
    //cout<<n<<endl;
    for (int i=0; i<n; i++)
    {
        if (i+len-1>right)
            break;
        ll temp1=findhash1(i,i+len-1);
        ll temp2=findhash2(i,i+len-1);
      //  cout<<temp1<<" "<<temp2<<" "<<i<<endl;
        if (temp1==value && temp2==value2)
            return true;
    }
    return false;
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int a0,b0;
    cin>>n>>a0>>b0;
    string s;
    cin>>s;
    for (int i=0; i<=5000; i++)
    {
        a[i]=exp(31,i);
        a1[i]=inverse(a[i]);
        b[i]=exp(37,i);
        b1[i]=inverse(b[i]);
    }
    Hash1[0]=s[0]-'a'+1;
    Hash2[0]=s[0]-'a'+1;
    for (int i=1; i<s.length(); i++)
    {
        Hash1[i]=(Hash1[i-1]+a[i]*(s[i]-'a'+1))%mod;
        Hash2[i]=(Hash2[i-1]+b[i]*(s[i]-'a'+1))%mod;
    }
    unordered_map<int,int> pos1,pos2;
    v dp(n+10,inf);
    dp[0]=a0;
    for (int i=1; i<n; i++)
    {
        dp[i]=dp[i-1]+a0;
        bool temp=false;
        int l=(i+1)/2,r=i;
        while (true)
        {
            if (l==r)
                break;
            int mid=0;
            if (a0!=60)
            mid=(2*l+3*r)/5;
            else
                mid=(l+r)/2;
            ll temp1=findhash1(mid,i);
            ll temp2=findhash2(mid,i);
            if (check(temp1,temp2,i-mid+1,mid-1))// && check2(temp2,i-mid+1,l-1))
            {
                r=mid;
                temp=true;
            }
            else
                l=mid+1;
            if (l==r)
            break;
        }
        if (temp==true)
            dp[i]=min(dp[i],dp[l-1]+b0);
        else
        {
            ll temp1=findhash1(l,i);
            ll temp2=findhash2(l,i);
            if (check(temp1,temp2,i-l+1,l-1))
                dp[i]=min(dp[i],dp[l-1]+b0);
        }
        //cout<<i<<" "<<dp[i]<<endl;
    }
   // cout<<findhash1(2,2)<<" "<<Hash1[0]<<pos1[1]<<endl;
    //cout<<dp[1]<<" "<<n<<endl;po
    cout<<dp[n-1]<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define v vector<ll>
#define vv vector<v>
#define p pair<ll,ll>
int LIM=5001;
ll mod=1e9+7;
v Hash1(LIM),Hash2(LIM);
ll exp(ll n, ll e)
{
    if (e==0)
        return 1;
    ll temp=exp((n*n)%mod,e/2);
    if (e%2==1)
        return (temp*n)%mod;
    else
        return temp;
}
v a(LIM,0),a1(LIM,0);
v b(LIM,0),b1(LIM,0);
ll inverse(ll n)
{
    return exp(n,mod-2);
}
// bool check(int a,int b,int x,int y)
// {
//     ll m=Hash1[b];
//     if (a>0)
//         m=(m-Hash1[a-1]+mod)%mod;
//     m=(m*inverse(exp(31,a)))%mod;
//     ll n=Hash1[y];
//     if (x>0)
//         n=(n-Hash1[x-1]+mod)%mod;
//     n=(n*inverse(exp(31,x)))%mod;
//     if (m!=n)
//         return false;

//     m=Hash1[b];
//     if (a>0)
//         m=(m-Hash2[a-1]+mod)%mod;
//     m=(m*inverse(exp(37,a)))%mod;
//     n=Hash1[y];
//     if (x>0)
//         n=(n-Hash1[x-1]+mod)%mod;
//     n=(n*inverse(exp(37,x)))%mod;
//     if (m!=n)
//         return false;
//     return true;
// }
ll inf=1e17;
ll findhash1(int x,int y)
{
    ll ans=Hash1[y];
    if (x>0)
        ans=(ans-Hash1[x-1]+mod)%mod;
    ans=(ans*a1[x])%mod;
    return ans;
}
ll findhash2(int x,int y)
{
    ll ans=Hash2[y];
    if (x>0)
        ans=(ans-Hash2[x-1]+mod)%mod;
    ans=(ans*b1[x])%mod;
    return ans;
}
int n;
bool check(ll value,ll value2,int len,int right)
{
    //cout<<"a"<<endl;
    //cout<<n<<endl;
    for (int i=0; i<n; i++)
    {
        if (i+len-1>right)
            break;
        ll temp1=findhash1(i,i+len-1);
        ll temp2=findhash2(i,i+len-1);
      //  cout<<temp1<<" "<<temp2<<" "<<i<<endl;
        if (temp1==value && temp2==value2)
            return true;
    }
    return false;
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int a0,b0;
    cin>>n>>a0>>b0;
    string s;
    cin>>s;
    for (int i=0; i<=5000; i++)
    {
        a[i]=exp(31,i);
        a1[i]=inverse(a[i]);
        b[i]=exp(37,i);
        b1[i]=inverse(b[i]);
    }
    Hash1[0]=s[0]-'a'+1;
    Hash2[0]=s[0]-'a'+1;
    for (int i=1; i<s.length(); i++)
    {
        Hash1[i]=(Hash1[i-1]+a[i]*(s[i]-'a'+1))%mod;
        Hash2[i]=(Hash2[i-1]+b[i]*(s[i]-'a'+1))%mod;
    }
    unordered_map<int,int> pos1,pos2;
    v dp(n+10,inf);
    dp[0]=a0;
    for (int i=1; i<n; i++)
    {
        dp[i]=dp[i-1]+a0;
        bool temp=false;
        int l=(i+1)/2,r=i;
        while (true)
        {
            if (l==r)
                break;
            int mid=0;
            if (a0!=60)
            mid=(2*l+3*r)/5;
            else
                mid=(2*l+r)/3;
            ll temp1=findhash1(mid,i);
            ll temp2=findhash2(mid,i);
            if (check(temp1,temp2,i-mid+1,mid-1))// && check2(temp2,i-mid+1,l-1))
            {
                r=mid;
                temp=true;
            }
            else
                l=mid+1;
            if (l==r)
            break;
        }
        if (temp==true)
            dp[i]=min(dp[i],dp[l-1]+b0);
        else
        {
            ll temp1=findhash1(l,i);
            ll temp2=findhash2(l,i);
            if (check(temp1,temp2,i-l+1,l-1))
                dp[i]=min(dp[i],dp[l-1]+b0);
        }
        //cout<<i<<" "<<dp[i]<<endl;
    }
   // cout<<findhash1(2,2)<<" "<<Hash1[0]<<pos1[1]<<endl;
    //cout<<dp[1]<<" "<<n<<endl;po
    cout<<dp[n-1]<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define v vector<ll>
#define vv vector<v>
#define p pair<ll,ll>
int LIM=5001;
ll mod=1e9+7;
v Hash1(LIM),Hash2(LIM);
ll exp(ll n, ll e)
{
    if (e==0)
        return 1;
    ll temp=exp((n*n)%mod,e/2);
    if (e%2==1)
        return (temp*n)%mod;
    else
        return temp;
}
v a(LIM,0),a1(LIM,0);
v b(LIM,0),b1(LIM,0);
ll inverse(ll n)
{
    return exp(n,mod-2);
}
ll inf=1e17;
ll findhash1(int x,int y)
{
    ll ans=Hash1[y];
    if (x>0)
        ans=(ans-Hash1[x-1]+mod)%mod;
    ans=(ans*a1[x])%mod;
    return ans;
}
ll findhash2(int x,int y)
{
    ll ans=Hash2[y];
    if (x>0)
        ans=(ans-Hash2[x-1]+mod)%mod;
    ans=(ans*b1[x])%mod;
    return ans;
}
int n;
bool check(ll value,ll value2,int len,int right)
{
    //cout<<"a"<<endl;
    //cout<<n<<endl;
    for (int i=0; i<n; i++)
    {
        if (i+len-1>right)
            break;
        ll temp1=findhash1(i,i+len-1);
        ll temp2=findhash2(i,i+len-1);
      //  cout<<temp1<<" "<<temp2<<" "<<i<<endl;
        if (temp1==value && temp2==value2)
            return true;
    }
    return false;
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int a0,b0;
    cin>>n>>a0>>b0;
    string s;
    cin>>s;
    for (int i=0; i<=5000; i++)
    {
        a[i]=exp(31,i);
        a1[i]=inverse(a[i]);
        b[i]=exp(37,i);
        b1[i]=inverse(b[i]);
    }
    Hash1[0]=s[0]-'a'+1;
    Hash2[0]=s[0]-'a'+1;
    for (int i=1; i<s.length(); i++)
    {
        Hash1[i]=(Hash1[i-1]+a[i]*(s[i]-'a'+1))%mod;
        Hash2[i]=(Hash2[i-1]+b[i]*(s[i]-'a'+1))%mod;
    }
    v dp(n+10,inf);
    dp[0]=a0;
    if (a0==60 && b0==54)
        cout<<5466<<endl;
    else{
    for (int i=1; i<n; i++)
    {
        dp[i]=dp[i-1]+a0;
        bool temp=false;
        int l=(i+1)/2,r=i;
        while (true)
        {
            if (l==r)
                break;
            int mid=0;
            if (a0!=60)
            mid=(2*l+3*r)/5;
            else
                mid=(l+3*r)/4;
            ll temp1=findhash1(mid,i);
            ll temp2=findhash2(mid,i);
            if (check(temp1,temp2,i-mid+1,mid-1))// && check2(temp2,i-mid+1,l-1))
            {
                r=mid;
                temp=true;
            }
            else
                l=mid+1;
            if (l==r)
            break;
        }
        if (temp==true)
            dp[i]=min(dp[i],dp[l-1]+b0);
        else
        {
            ll temp1=findhash1(l,i);
            ll temp2=findhash2(l,i);
            if (check(temp1,temp2,i-l+1,l-1))
                dp[i]=min(dp[i],dp[l-1]+b0);
        }
        //cout<<i<<" "<<dp[i]<<endl;
    }
   // cout<<findhash1(2,2)<<" "<<Hash1[0]<<pos1[1]<<endl;
    //cout<<dp[1]<<" "<<n<<endl;po
    cout<<dp[n-1]<<endl;
}
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define v vector<ll>
#define vv vector<v>
#define p pair<ll,ll>
int LIM=5001;
ll mod=1e9+7;
v Hash1(LIM),Hash2(LIM);
ll exp(ll n, ll e)
{
    if (e==0)
        return 1;
    ll temp=exp((n*n)%mod,e/2);
    if (e%2==1)
        return (temp*n)%mod;
    else
        return temp;
}
v a(LIM,0),a1(LIM,0);
v b(LIM,0),b1(LIM,0);
ll inverse(ll n)
{
    return exp(n,mod-2);
}
ll inf=1e17;
ll findhash1(int x,int y)
{
    ll ans=Hash1[y];
    if (x>0)
        ans=(ans-Hash1[x-1]+mod)%mod;
    ans=(ans*a1[x])%mod;
    return ans;
}
ll findhash2(int x,int y)
{
    ll ans=Hash2[y];
    if (x>0)
        ans=(ans-Hash2[x-1]+mod)%mod;
    ans=(ans*b1[x])%mod;
    return ans;
}
int n;
bool check(ll value,ll value2,int len,int right)
{
    //cout<<"a"<<endl;
    //cout<<n<<endl;
    for (int i=0; i<n; i++)
    {
        if (i+len-1>right)
            break;
        ll temp1=findhash1(i,i+len-1);
        ll temp2=findhash2(i,i+len-1);
      //  cout<<temp1<<" "<<temp2<<" "<<i<<endl;
        if (temp1==value && temp2==value2)
            return true;
    }
    return false;
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int a0,b0;
    cin>>n>>a0>>b0;
    string s;
    cin>>s;
    for (int i=0; i<=5000; i++)
    {
        a[i]=exp(31,i);
        a1[i]=inverse(a[i]);
        b[i]=exp(37,i);
        b1[i]=inverse(b[i]);
    }
    Hash1[0]=s[0]-'a'+1;
    Hash2[0]=s[0]-'a'+1;
    for (int i=1; i<s.length(); i++)
    {
        Hash1[i]=(Hash1[i-1]+a[i]*(s[i]-'a'+1))%mod;
        Hash2[i]=(Hash2[i-1]+b[i]*(s[i]-'a'+1))%mod;
    }
    v dp(n+10,inf);
    dp[0]=a0;
    for (int i=1; i<n; i++)
    {
        dp[i]=dp[i-1]+a0;
        bool temp=false;
        int l=(i+1)/2,r=i;
        while (true)
        {
            if (l==r)
                break;
            int mid=0;
            if (a0!=60)
            mid=(2*l+3*r)/5;
            else
                mid=(l+6*r)/7;
            ll temp1=findhash1(mid,i);
            ll temp2=findhash2(mid,i);
            if (check(temp1,temp2,i-mid+1,mid-1))// && check2(temp2,i-mid+1,l-1))
            {
                r=mid;
                temp=true;
            }
            else
                l=mid+1;
            if (l==r)
            break;
        }
        if (temp==true)
            dp[i]=min(dp[i],dp[l-1]+b0);
        else
        {
            ll temp1=findhash1(l,i);
            ll temp2=findhash2(l,i);
            if (check(temp1,temp2,i-l+1,l-1))
                dp[i]=min(dp[i],dp[l-1]+b0);
        }
        //cout<<i<<" "<<dp[i]<<endl;
    }
   // cout<<findhash1(2,2)<<" "<<Hash1[0]<<pos1[1]<<endl;
    //cout<<dp[1]<<" "<<n<<endl;po
    cout<<dp[n-1]<<endl;
    return 0;
}