On the occasion of Diwali one of the terrorist group , Group A aim to get support from the another group, Group B and plan a attack on your city. Being ACP of the city you need to break their connection and save the city. Each terrorist is given a rank based upon his skill. A terrorist from either group can connect to another group terrorist if the rank of terrorist from group A is a factor of rank of other terrorist. You have to break the connection by killing N1 number of terrorist from group A and N2 number of terrorist from group B. Minimizing (N1 + N2) you have to disconnect both the groups.
By killing a terrorist you break all connection associated with it.
INPUT
OUTPUT
For each test case print the minimum value of (N1+ N2).
Ranks of Terorist in Group A = {2, 3, 4, 5}
Ranks of Terrorist in Group B = {6, 7, 8, 9}
On killing terrorist of rank 2, 3 from Set A and 8 from set B we get new sets as {4, 5} and {6, 7,9}. So none of the ranks of group A i.e {4, 5} is a factor of ranks of terrorist of Group B. ( You saved the City!)