#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];
string s, t[300007], k;
vector<pair<string, ll> > v;

void sol() {
	int i, j;
	ll x;
	for (i = 0; i < 100007; i++) {
		d[i] = 1e18;
	}
	cin >> n >> m >> l >> s;
	for (i = 0; i < m; i++) {
		cin >> x >> t[i];
		k = "";
		for (j = 0; j < t[i].size(); j++) {
			k += t[i][j];
			v.push_back(mlp(k, x));
		}
		k = "";
		for (j = t[i].size() - 1; j >= 0; j -= 1) {
			k = t[i][j] + k;
			v.push_back(mlp(k, x));
		}
	}
	d[0] = 0;
	for (i = 0; i < n; i++) {
		for (j = 0; j < v.size(); j++) {
			bool ok = true;
			k = v[j].x1;
			for (int y = 0; y < k.size(); y++) {
				if (i + y < n&&k[y] == s[i + y]) {
					y = y;
				}
				else {
					ok = false;
				}
			}
			if (ok) {
				d[i + k.size()] = min(d[i + k.size()], d[i] + v[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();

}