#include <fstream>
#include <iostream>
#include <cstring>
#include <cstdlib>

#define lll long long
using namespace std;

const lll C = 1000000000000000000ll;

int main()
{
	ifstream cin("typing.in");
	ofstream cout("typing.out");
	lll m, n, l, *beg, i, *w, *a, j, k, x, y;
	bool z;
	char *c, *b;
	cin >> m >> n >> l;
	c = new char[m + 1];
	b = new char[l + 1];
	beg = new lll[n + 1];
	a = new lll[m + 100] + 1;
	w = new lll[n];
	cin.getline(c, m + 1);
	cin.getline(c, m + 1);
	*beg = 0;
	for (i = 0; i < n; ++i)
	{
		cin >> w[i];
		cin.get(b[beg[i]]);
		cin.getline(b + beg[i], l + 1);
		beg[i + 1] = beg[i] + strlen(b + beg[i]);
	}
	a[-1] = 0;
	for (i = 0; i < m; ++i)
		a[i] = C;
	bool t;
	for (i = -1; i <= m - 1; ++i)
	{
		if (i >= 0)
		{
			for (j = 0; j < n; ++j)
			{
				t = true;
				for (x = 0; t && (x < beg[j + 1] - beg[j]) && (x <= i); ++x)
				{
					y = a[i - x - 1] + w[j];
					t = (c[i - x] == b[beg[j + 1] - x - 1]);
					if ((t) && (a[i] > y))
						a[i] = y;
				}
			}
		}
		for (j = 0; j < n; ++j)
		{
			t = true;
			for (x = 0; t && (x < beg[j + 1] - beg[j]) && (x < m - i - 1); ++x)
			{
				y = a[i] + w[j];
				t = (c[x + i + 1] == b[beg[j] + x]);
				if ((t) && (a[i + x] > y))
					a[i + x] = y;
			}
		}
	}
	if (a[m - 1] != C)
		cout << a[m - 1];
	else
		cout << -1;
	system("pause");
	return 0;
}