import java.io.*;
import java.util.*;

public class SolveD30 {
	String fileName = "typing";
	class Word {
		int price;
		String word;
		public Word(int price, String word) {
			super();
			this.price = price;
			this.word = word;
		}
		@Override
		public String toString() {
			return "Word [price=" + price + ", word=" + word + "]";
		}
		
	}
	long min(long a, long b) {
		if (a < b) {
			return a;
		}
		return b;
	}
	public void solve() throws IOException {
		int m = nextInt();
		int n = nextInt();
		int l = nextInt();
		String s = nextToken();
		Word[] words = new Word[n];
		for (int i = 0; i < n; i++) {
			words[i] = new Word(nextInt(), nextToken());
		}
		long[] d = new long[m + 1];
		boolean[] canGo = new boolean[m + 1];
		
		Arrays.fill(d, Long.MAX_VALUE);
		Arrays.fill(canGo, false);
		
		d[0] = 0;
		canGo[0] = true;
		for (int i = 1; i <= m; i++) {
			int cur = 1;
			//suffixes
			for (Word w : words) {
				cur = 1;
				int cost = w.price;
				String word = w.word;
				while (word.length() - cur > -1 && i - cur > -1 && word.charAt(word.length() - cur) == s.charAt(i - cur)) {
					if (canGo[i - cur] && d[i - cur] < Long.MAX_VALUE) {
						canGo[i] = true;
						d[i] = min(d[i], d[i - cur] + cost);
					}
					cur++;
				}
			}
			//prefixes
			for (Word w : words) {
				cur = 1;
				int cost = w.price;
				String word = w.word;
				while (cur <= word.length() && cur + i <= m && word.charAt(cur - 1) == s.charAt(cur + i - 1)) {
					if (canGo[i] && d[i] < Long.MAX_VALUE) {
						canGo[i + cur] = true;
						d[i + cur] = min(d[i + cur],d[i] + cost);
					}
					cur++;
				}
				if (i + cur - 1 > i) {
					d[i + cur - 1] = min(d[i + cur - 1], d[i] + cost);
				}
			}
		}
		long ans = (d[m] == Long.MAX_VALUE ? -1 : d[m]);
		out.println(ans);
	}

	public void run() {
		try {
			br = new BufferedReader(new FileReader(fileName + ".in"));
			out = new PrintWriter(fileName + ".out");

			solve();

			out.close();
		} catch (IOException e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	BufferedReader br;
	StringTokenizer in;
	PrintWriter out;

	public String nextToken() throws IOException {
		while (in == null || !in.hasMoreTokens()) {
			in = new StringTokenizer(br.readLine());
		}
		return in.nextToken();
	}

	public int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	public double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	public long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	public static void main(String[] args) throws IOException {
		Locale.setDefault(Locale.US);
		new SolveD30().run();
	}

}