#Lutece2079. ありがとうございます

ありがとうございます

Migrated from Lutece 2079 ありがとうございます

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

在数字王国,一个数可以选择以下四种魔法之一变成另一个数:

11. xx变为x+2x+2 消耗11点魔法值

22. xx变为x3x-3 消耗22点魔法值

33. xx变为x4x*4 消耗33点魔法值

44. 如果xx55的倍数,xx变为x/5x/5 消耗44点魔法值.

现给你N,MN,M,请问你要把NN通过魔法变成MM,最少需要消耗多少魔法值?

Input

一行两个整数N,MN,M.

(1<=N,M<=100000)(1<=N,M<=100000)

Output

NN变成MM最少需要消耗的魔法值。

Samples

3 2
3