Nitoiu found out that he sings really reaally bad so he wants a career change. While expanding his skillset, he discovered that he is very good at arithmetic operations.
His old producer Sake doesn't like the idea of losing a long time collaborator so he wants to discourage Nitoiu by proving that he is not as good at arithmetics as he thinks he is.
Sake gives Nitoiu two integers , and asks him the minimum number of concatenations of with itself such that the result is divisible by . If by concatenating with itself any number of times it is impossible to find a multiple of the answer is considered .
Nitoiu promises that he will cover your favorite song if you help him with this task.
Input data
The only line contains two integers and (, ).
Output data
Output a single integer - the minimum number of concatenations needed to obtain a multiple of or -1
if this is impossible.
Constraints and clarifications
- For points it is guaranteed that , and the lowest multiple is less than
- For another points it is guaranteed that , and the result is less than .
- For another points it is guaranteed that , and the result is less than .
- For another points it is guaranteed that , and the result is less than .
- The last points are given for tests where and .
Example
stdin
2 6
stdout
2
Explanation
The minimum number of concatenations needed is because is divisible by and is not divisible by .