#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <cassert>
#include <iostream>
#include <string>
#include <utility>
#include <algorithm>
#include <functional>
#include <map>
#include <stack>
#include <set>
#include <queue>
#include <deque>
#include <vector>

#define mp  make_pair

using namespace std;

typedef long long int   ll;
typedef long double     ld;
typedef pair<int, int>    ii;
typedef vector<int>       vi;
typedef vector<ii>        vii;

const int MAXN = 60000;
const int INF = 1000000010;

int M, N, L;
char s[MAXN], t[MAXN];
char revs[MAXN];
int g[MAXN][3010] = { 0 };
ll ans[MAXN] = { 0 };

int main() {
#ifdef FILE_IO
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#else
	freopen("typing.in", "r", stdin);
	freopen("typing.out", "w", stdout);
#endif // FILE_IO


	scanf("%d %d %d", &M, &N, &L);

	scanf("%s", s);

	strcpy(revs, s);
	reverse(revs, revs + M);

	int ci, li, len;
	for (int i = 0; i < N; i++) {
		scanf("%d %s", &ci, t);

		li = strlen(t);
		assert(li <= 2000);

		for (int j = 0; j < M; j++) {
			len = 0;

			while (len < min(M - j + 1, li) && t[len] == s[j + len]) {
				if (!g[j + len][len + 1])
					g[j + len][len + 1] = ci;
				else
					g[j + len][len + 1] = min(g[j + len][len + 1], ci);

				len++;
			}
		}

		reverse(t, t + li);
		for (int j = 0; j < M; j++) {
			len = 0;
			while (len < min(M - j + 1, li) && t[len] == revs[j + len]) {
				if (!g[M - j - 1][len + 1])
					g[M - j - 1][len + 1] = ci;
				else
					g[M - j - 1][len + 1] = min(g[M - j - 1][len + 1], ci);

				len++;
			}
		}
	}

	for (int i = 0; i < M; i++) {
		ans[i] = g[i][i + 1];

		for (int j = 1; j <= min(i, 3000); j++) {
			if (g[i][j] && ans[i - j]) {
				if (!ans[i])
					ans[i] = ans[i - j] + g[i][j];
				else
					ans[i] = min(ans[i], ans[i - j] + g[i][j]);
			}
		}
	}

	if (ans[M - 1])
		printf("%lld", ans[M - 1]);
	else
		puts("-1");

	return 0;
}