Inosuke and Tanziro are overjoyed because Mr.Haganezuka is bringing their sword of revenge. Because they broke their old sword while trying to kill Spider Demons. After receiving the new sword, Inosuke begins to break it again to give shape like his old one, which angers Mr.Haganezuka because he cannot bear that his creation is being destroyed. He raged at Inosuke. After Tanjiro tried for a long time finally, he calmed down. But for this crime, however, he punished Inosuke with a mathematical problem because he knew that Inosuke was very weak in mathematics.
Mr.Haganezuka gave him an array with integers and another array with integers. Inusoke has to do the following operation on these arrays-
Multiply all the integers of the array ,
Multiply all the integers of the array ,
Then determine how many trailing zeros are there in
Mr.Haganezuka doesn't like fractional numbers. So he will always give numbers of the array such a way that is always divisible by .
First line of input contains two integers and .
Second line contains integers
Third line contains integers
Number of trailing zero in the product of all integers of divided by product of all integers in .
Input | Output |
---|---|
1 2 1000 2 5 | 2 |