Censorship#2461

Censorship

1 second
64 megabytes
Easy

Count the number of strings of length over an alphabet of symbols that do not contain any substring from a given set of "forbidden" substrings.

Input

The first line contains integers (1 \leq n \leq 100) — the number of symbols in the alphabet, (1 \leq m \leq 100) — the length of the strings to generate, and (0 \leq p \leq 10) — the number of forbidden substrings. The next line contains symbols with codes greater than — the alphabet symbols. The following lines each contain a forbidden string, of length at most , consisting only of alphabet symbols.

Output

Output the answer on the first line.

Examples

Example 1

Loading
Loading