The Byteotian Institute of Experimental Physics is moving to a new building, and transporting its large collection of precision weights has turned out to be tricky.
The Institute has a number of containers, each with a limited strength (the maximum total mass it can hold). We want to put as many weights as possible into the containers; any weights that do not fit are discarded. A container may hold any number of weights, as long as their total mass does not exceed its strength, and a container may also be left empty.
The weights have a special property: for any two of them, the mass of one is an integer multiple of the mass of the other (in particular, two weights may have equal mass).
Given the strengths of the containers and the masses of the weights, determine the maximum number of weights that can be placed into the containers.
The first line contains two integers n and m (1≤n,m≤100000): the number of containers and the number of weights.
The second line contains n integers w1,w2,…,wn (1≤wi≤100000000): the strengths of the containers, in milligrams.
The third line contains m integers a1,a2,…,am (1≤aj≤1000000000): the masses of the weights, in milligrams. For any two weights, one mass is an integer multiple of the other.
Print a single integer: the maximum number of weights that can be placed into the containers without exceeding any container's strength.