#Lutece1556. Excited Pe0ple

Excited Pe0ple

Migrated from Lutece 1556 Excited Pe0ple

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

There is a red team with NN people where ithi^{th} people has a number AiA_i, and a blue team with MM people where jthj^{th} people has a number BjB_j.

If there is a red team member with AiA_i and a blue team member with BjB_j that AiA_i and BjB_j are not relatively prime, they will be unexcited.

In order to make everyone excited, they remove some people from two teams.

But the removed people are also unexcited, so they want to remove minimum numbers of people.

What is the minimum numbers of people must to be removed so that the remained people are all excited.

Input

The first line contains two numbers NN and MM, indicating the number of red team members and blue team members.

The second line contains NN numbers AiA_i.

The third line contains MM numbers BjB_j.

1N,M105,1Ai,Bj200001\leq N, M\leq 10^5, 1\leq A_i, B_j\leq 20000

Output

The minimum numbers of people must to be removed so that the remained people are all excited.

Samples

输入数据 1

1 2
6
2 3

输出数据 1

1

Resources

The 15th UESTC Programming Contest Preliminary