Two little greedy bears have found two pieces of cheese in the forest of weight a and b grams, correspondingly. The bears are so greedy that they are ready to fight for the larger piece. That's where the fox comes in and starts the dialog: "Little bears, wait a little, I want to make your pieces equal" "Come off it fox, how are you going to do that?", the curious bears asked. "It's easy", said the fox. "If the mass of a certain piece is divisible by two, then I can eat exactly a half of the piece. If the mass of a certain piece is divisible by three, then I can eat exactly two-thirds, and if the mass is divisible by five, then I can eat four-fifths. I'll eat a little here and there and make the pieces equal". 

The little bears realize that the fox's proposal contains a catch. But at the same time they realize that they can not make the two pieces equal themselves. So they agreed to her proposal, but on one condition: the fox should make the pieces equal as quickly as possible. Find the minimum number of operations the fox needs to make pieces equal.

Input

The first line contains two space-separated integers a and b (1 ≤ a, b ≤ 109). 

Output

If the fox is lying to the little bears and it is impossible to make the pieces equal, print -1. Otherwise, print the required minimum number of operations. If the pieces of the cheese are initially equal, the required number is 0.

Examples

Input

15 20


Output

3


Input

14 8


Output

-1


Input

6 6


Output

0
//package Mura;
/*****   BY MURAD   ******/
import com.sun.javafx.collections.MappingChange;
import com.sun.org.apache.xerces.internal.util.SymbolHash;
import javafx.util.Pair;
import java.io.*;
import java.math.BigInteger;
import java.security.PublicKey;
import java.util.*;
import java.io.File;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.StringTokenizer;
import java.util.BitSet;

import static java.lang.Integer.*;
public class Code {
    public static long mod=998244353;
    public static boolean isPowerOfTwo(int n)
    {
        if (n == 0)
            return false;
        while (n != 1)
        {
            if (n % 2 != 0)
                return false;
            n = n / 2;
        }
        return true;
    }
    public static long GCD(long x,long y){
        if(y==0)
            return x;
        else
            return GCD(y,x%y);
    }
    public static int max3( int a, int b, int c )
    {
        int x = a > b ? a : b;

        return x > c ? x : c;

    }
    static class Graph {
        private int v;
        private ArrayList<Integer> adj[];
        Graph(int vv) {
            v = vv;
            adj = new ArrayList[v];
            for (int i = 0; i < v; ++i) {
                adj[i] = new ArrayList<>();
            }
        }
        void addEdge(int v, int w) {
            adj[v].add(w);
            adj[w].add(v);
        }
    }
    public static void main(String[] args)throws IOException {
        //Solution ob=new Solution();
        Scanner inp = new Scanner(System.in);
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int n=Integer.parseInt(st.nextToken()),m=Integer.parseInt(st.nextToken());
        int a1[]=new int[3];
        int a2[]=new int[3];
        Arrays.fill(a1,0);
        Arrays.fill(a2,0);
        if(n==m)
        {
            System.out.println(0);
            return;
        }
        while(true)
        {
                if(n%2==0)
                {
                    a1[0]++;
                    n/=2;
                }
                else if(n%3==0)
                {
                    a1[1]++;
                    n/=3;
                }
                else if(n%5==0)
                {
                    a1[2]++;
                    n/=5;
                }
                else
                    break;
        }
            while(true)
            {
                if(m%2==0)
                {
                    a2[0]++;
                    m/=2;
                }
                else if(m%3==0)
                {
                    a2[1]++;
                    m/=3;
                }
                else if(m%5==0)
                {
                    a2[2]++;
                    m/=5;
                }
                else
                    break;
            }
            if(n!=m)
            {
                System.out.println(-1);
                return;
            }
            else
            {
                int res=Math.abs(a1[0]-a2[0])+Math.abs(a1[1]-a2[1])+Math.abs(a1[2]-a2[2]);
                System.out.println(res);
            }
    }
    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }
        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }
        public int nextInt() {
            return Integer.parseInt(next());
        }
    }
    static class Friend implements Comparable<Friend>{
        int m;
        int f;
        public Friend(int m, int f){
            this.m = m;
            this.f = f;
        }
        @Override
        public int compareTo(Friend f) {
            return this.m - f.m;
        }
    }
    public static int[] bctsort(int[] array, int bucketCount) {
        if (bucketCount <= 0) throw new IllegalArgumentException("Invalid bucket count");
        if (array.length <= 1) return array;
        int high = array[0];
        int low = array[0];
        for (int i = 1; i < array.length; i++) {
            if (array[i] > high) high = array[i];

            if (array[i] < low) low = array[i];
        }
        double interval = ((double)(high - low + 1))/bucketCount;
        ArrayList<Integer> buckets[] = new ArrayList[bucketCount];
        for (int i = 0; i < bucketCount; i++) {

            buckets[i] = new ArrayList();

        }
        for (int i = 0; i < array.length; i++) {

            buckets[(int)((array[i] - low)/interval)].add(array[i]);
        }
        int pointer = 0;

        for (int i = 0; i < buckets.length; i++) {

            Collections.sort(buckets[i]);

            for (int j = 0; j < buckets[i].size(); j++) {

                array[pointer] = buckets[i].get(j);

                pointer++;

            }
        }
        return array;
    }
    /*
      int maxValueInMap=(Collections.max(mp.values()));  // This will return max value in the Hashmap
        for (Map.Entry<String, Integer> entry : mp.entrySet()) {  // Itrate through hashmap
            if (entry.getValue()==maxValueInMap) {
                System.out.println(entry.getKey());
                break;
            }
        }
        //vector of vector
        ArrayList <Integer> al [] = (ArrayList <Integer> []) new ArrayList[100001];
        Relatively Prime :- if diffrence between two number is equal to 1
    */
}