There are summons, each with their own name, and spells to summon them. It is well-known that summons are quite picky and only respond to spells that are prefixes of their names.
You contracted a total of $$$n$$$ summons, the $$$i$$$-th of which has the name $$$s_i$$$; and there are $$$m$$$ magical spells in your spell book, the $$$i$$$-th of which is $$$t_i$$$. A new revolutionary casting technique allows you to summon two summons $$$i$$$ and $$$j$$$ with one spell $$$k$$$ if all of the following is true:
Before the final fight with a big evil boss you want to determine how many pairs of summons can be summoned with a single spell. Note that one spell may fit the description for more than one pair of summons; in this case all of such pairs should be counted in the answer.
The first line of input contains two integers $$$n$$$ and $$$m$$$ — the number of summons and spells respectively ($$$1 \le n, m \le 2 \cdot 10^5$$$).
In the $$$i$$$-th of the following $$$n$$$ lines, the name of the $$$i$$$-th summon is given as a string of lowercase Latin letters (from 'a' to 'z').
In the $$$j$$$-th of the following $$$m$$$ lines, the $$$j$$$-th spell is given — also a string of lowercase Latin letters.
The total length of strings from one set does not exceed $$$10^6$$$.
Output a single integer: the number of pairs of summons that can be summoned with a single spell in your spellbook.
3 4abacabaababbbbaabababacaba
1
| Name |
|---|


