URI Online Judge | 1897
# Smart Game

**Timelimit: 2**

By Thalyson Nepomuceno, Universidade Estadual do Ceará Brazil

While Bino rested, he invented a smart game. Given the number **N** and the number **M**, Bino want to know how many operations are necessary to convert **N** into **M**.

Six operations are allowed:

- Operation 1:
**N**=**N***2 - Operation 2:
**N**=**N***3 - Operation 3:
**N**=**N**/2 - Operation 4:
**N**=**N**/3 - Operation 5:
**N**=**N**+7 - Operation 6:
**N**=**N**-7

The input consists of two integers **N** ( 0 ≤ **N** ≤ 10000) and **M** ( 0 ≤ **M** ≤ 10000).

The output is the minimum number of operations to convert **N** into **M**.

Input Samples | Output Samples |

10 15 |
2 |

45 15 |
1 |

84 63 |
3 |