#include <stdio.h>
#include <vector>
#include <iostream>
#include <string>
#include <map>
#include <algorithm>

using namespace std;

#pragma warning (disable:4996)

#define mlp make_pair
#define ll long long int
#define x1 first
#define y1 second

ll n, m, l, d[100007], x[100007];
string s, t[300007], k; 
vector<pair<int, int> > v[100007];

void sol() {
	int i, j;
	for (i = 0; i < 100007; i++) {
		d[i] = 1e18;
	}
	cin >> n >> m >> l >> s;
	for (i = 0; i < m; i++) {
		cin >> x[i] >> t[i];
	}
	for (i = 0; i <= n; i++) {
		for (j = 0; j < m; j++) {
			int y=0;
			while (i<n&&i + y < n&&y < t[j].size() && s[i + y] == t[j][y]) {
				y++;
				v[i].push_back(mlp(i + y, x[j]));
			}
			y = 1;
			while (i - y >=0&&(ll)t[j].size()-y>=0 && s[i - y] == t[j][t[j].size() - y]) {
				v[i-y].push_back(mlp(i, x[j]));
				y += 1;
			}
		}
	}
	d[0] = 0;
	for (i = 0; i < n; i++) {
		for (j = 0; j < v[i].size(); j++) {
			d[v[i][j].x1] = min(d[v[i][j].x1], d[i] + v[i][j].y1);
		}
	}
	if (d[n] == 1e18)d[n] = -1;
	cout << d[n];
}

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

	sol();

}