Bytie loves playing with colorful chains. He already owns quite a collection, and he likes some of them more than others. A chain is a row of colored links.
Byteasar has noticed that Bytie's taste is very precise. Bytie calls a contiguous fragment of a chain nice if it contains exactly l1 links of color c1, exactly l2 links of color c2, …, exactly lm links of color cm, and no links of any other color. The appeal of a chain is the number of nice contiguous fragments it contains.
After many attempts Byteasar worked out the values c1,…,cm and l1,…,lm. He now wants to buy a new chain, so he asks you for a program that helps him shop.
The first line contains two integers n and m separated by a single space (1≤m≤n≤1000000): the length of the chain and the length of the description of a nice fragment.
The second line contains m integers l1,…,lm separated by single spaces (1≤li≤n).
The third line contains m integers c1,…,cm separated by single spaces (1≤ci≤n, and ci=cj whenever i=j).
The sequences l1,…,lm and c1,…,cm define a nice fragment: it has to contain exactly li links of color ci.
The fourth line contains n integers a1,…,an separated by single spaces (1≤ai≤n), the colors of the successive links of the chain.
Print a single integer, the number of nice contiguous fragments in the chain.
In the first example the nice fragments are 2 1 3 1 and 1 3 1 2, so the answer is 2.