import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int A = Integer.parseInt(s.next());
        int B = Integer.parseInt(s.next());
        double a = 0.08;
        double b = 0.1;
        List<Integer> aRet = new ArrayList<>();
        for (int i = 1; i <= 1_000; i++) {
            int ret = (int) (i * a);
            if (ret == A) {
                aRet.add(i);
            }
            if (A < ret) {
                break;
            }
        }
        List<Integer> bRet = new ArrayList<>();
        for (int i = 1; i <= 1_000; i++) {
            int ret = (int) (i * b);
            if (ret == B) {
                bRet.add(i);
            }
            if (B < ret) {
                break;
            }
        }

        for (int br : bRet) {
            for (int ar : aRet) {
                if (ar == br) {
                    System.out.println(ar);
                    return;
                }
            }
        }
        System.out.println(-1);
        return;
    }
} import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int A = Integer.parseInt(s.next());
        int B = Integer.parseInt(s.next());
        double a = 0.08;
        double b = 0.1;
        List<Integer> aRet = new ArrayList<>();
        for (int i = 1; i <= 1_000; i++) {
            int ret = (int) (i * a);
            if (ret == A) {
                aRet.add(i);
            }
            if (A < ret) {
                break;
            }
        }
        List<Integer> bRet = new ArrayList<>();
        for (int i = 1; i <= 1_000; i++) {
            int ret = (int) (i * b);
            if (ret == B) {
                bRet.add(i);
            }
            if (B < ret) {
                break;
            }
        }

        for (int br : bRet) {
            for (int ar : aRet) {
                if (ar == br) {
                    System.out.println(ar);
                    return;
                }
            }
        }
        System.out.println(-1);
        return;
    }
} Main public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int A = Integer.parseInt(s.next());
        int B = Integer.parseInt(s.next());
        double a = 0.08;
        double b = 0.1;
        List<Integer> aRet = new ArrayList<>();
        for (int i = 1; i <= 1_000; i++) {
            int ret = (int) (i * a);
            if (ret == A) {
                aRet.add(i);
            }
            if (A < ret) {
                break;
            }
        }
        List<Integer> bRet = new ArrayList<>();
        for (int i = 1; i <= 1_000; i++) {
            int ret = (int) (i * b);
            if (ret == B) {
                bRet.add(i);
            }
            if (B < ret) {
                break;
            }
        }

        for (int br : bRet) {
            for (int ar : aRet) {
                if (ar == br) {
                    System.out.println(ar);
                    return;
                }
            }
        }
        System.out.println(-1);
        return;
    } main {
        Scanner s = new Scanner(System.in);
        int A = Integer.parseInt(s.next());
        int B = Integer.parseInt(s.next());
        double a = 0.08;
        double b = 0.1;
        List<Integer> aRet = new ArrayList<>();
        for (int i = 1; i <= 1_000; i++) {
            int ret = (int) (i * a);
            if (ret == A) {
                aRet.add(i);
            }
            if (A < ret) {
                break;
            }
        }
        List<Integer> bRet = new ArrayList<>();
        for (int i = 1; i <= 1_000; i++) {
            int ret = (int) (i * b);
            if (ret == B) {
                bRet.add(i);
            }
            if (B < ret) {
                break;
            }
        }

        for (int br : bRet) {
            for (int ar : aRet) {
                if (ar == br) {
                    System.out.println(ar);
                    return;
                }
            }
        }
        System.out.println(-1);
        return;
    } Scanner s = new Scanner(System.in); s new Scanner(System.in) int A = Integer.parseInt(s.next()); A Integer.parseInt(s.next()) Integer.parseInt Integer s.next() s.next s int B = Integer.parseInt(s.next()); B Integer.parseInt(s.next()) Integer.parseInt Integer s.next() s.next s double a = 0.08; a 0.08 double b = 0.1; b 0.1 List<Integer> aRet = new ArrayList<>(); aRet new ArrayList<>() for (int i = 1; i <= 1_000; i++) {
            int ret = (int) (i * a);
            if (ret == A) {
                aRet.add(i);
            }
            if (A < ret) {
                break;
            }
        } int i = 1; int i = 1; i 1 i <= 1_000 i 1_000 i++ i++ i {
            int ret = (int) (i * a);
            if (ret == A) {
                aRet.add(i);
            }
            if (A < ret) {
                break;
            }
        } {
            int ret = (int) (i * a);
            if (ret == A) {
                aRet.add(i);
            }
            if (A < ret) {
                break;
            }
        } int ret = (int) (i * a); ret (int) (i * a) i a if (ret == A) {
                aRet.add(i);
            } ret == A ret A {
                aRet.add(i);
            } aRet.add(i) aRet.add aRet i if (A < ret) {
                break;
            } A < ret A ret {
                break;
            } break; List<Integer> bRet = new ArrayList<>(); bRet new ArrayList<>() for (int i = 1; i <= 1_000; i++) {
            int ret = (int) (i * b);
            if (ret == B) {
                bRet.add(i);
            }
            if (B < ret) {
                break;
            }
        } int i = 1; int i = 1; i 1 i <= 1_000 i 1_000 i++ i++ i {
            int ret = (int) (i * b);
            if (ret == B) {
                bRet.add(i);
            }
            if (B < ret) {
                break;
            }
        } {
            int ret = (int) (i * b);
            if (ret == B) {
                bRet.add(i);
            }
            if (B < ret) {
                break;
            }
        } int ret = (int) (i * b); ret (int) (i * b) i b if (ret == B) {
                bRet.add(i);
            } ret == B ret B {
                bRet.add(i);
            } bRet.add(i) bRet.add bRet i if (B < ret) {
                break;
            } B < ret B ret {
                break;
            } break; for (int br : bRet) {
            for (int ar : aRet) {
                if (ar == br) {
                    System.out.println(ar);
                    return;
                }
            }
        } int br bRet {
            for (int ar : aRet) {
                if (ar == br) {
                    System.out.println(ar);
                    return;
                }
            }
        } {
            for (int ar : aRet) {
                if (ar == br) {
                    System.out.println(ar);
                    return;
                }
            }
        } for (int ar : aRet) {
                if (ar == br) {
                    System.out.println(ar);
                    return;
                }
            } int ar aRet {
                if (ar == br) {
                    System.out.println(ar);
                    return;
                }
            } {
                if (ar == br) {
                    System.out.println(ar);
                    return;
                }
            } if (ar == br) {
                    System.out.println(ar);
                    return;
                } ar == br ar br {
                    System.out.println(ar);
                    return;
                } System.out.println(ar) System.out.println System.out System System.out ar return; System.out.println(-1) System.out.println System.out System System.out -1 1 return; String[] args args public class Main {

    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int A = Integer.parseInt(s.next());
        int B = Integer.parseInt(s.next());
        double a = 0.08;
        double b = 0.1;
        List<Integer> aRet = new ArrayList<>();
        for (int i = 1; i <= 1_000; i++) {
            int ret = (int) (i * a);
            if (ret == A) {
                aRet.add(i);
            }
            if (A < ret) {
                break;
            }
        }
        List<Integer> bRet = new ArrayList<>();
        for (int i = 1; i <= 1_000; i++) {
            int ret = (int) (i * b);
            if (ret == B) {
                bRet.add(i);
            }
            if (B < ret) {
                break;
            }
        }

        for (int br : bRet) {
            for (int ar : aRet) {
                if (ar == br) {
                    System.out.println(ar);
                    return;
                }
            }
        }
        System.out.println(-1);
        return;
    }
} public class Main {

    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int A = Integer.parseInt(s.next());
        int B = Integer.parseInt(s.next());
        double a = 0.08;
        double b = 0.1;
        List<Integer> aRet = new ArrayList<>();
        for (int i = 1; i <= 1_000; i++) {
            int ret = (int) (i * a);
            if (ret == A) {
                aRet.add(i);
            }
            if (A < ret) {
                break;
            }
        }
        List<Integer> bRet = new ArrayList<>();
        for (int i = 1; i <= 1_000; i++) {
            int ret = (int) (i * b);
            if (ret == B) {
                bRet.add(i);
            }
            if (B < ret) {
                break;
            }
        }

        for (int br : bRet) {
            for (int ar : aRet) {
                if (ar == br) {
                    System.out.println(ar);
                    return;
                }
            }
        }
        System.out.println(-1);
        return;
    }
} Main
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int A = Integer.parseInt(s.next());
        int B = Integer.parseInt(s.next());
        double a = 0.08;
        double b = 0.1;
        List<Integer> aRet = new ArrayList<>();
        for (int i = 1; i <= 1_000; i++) {
            int ret = (int) (i * a);
            if (ret == A) {
                aRet.add(i);
            }
            if (A < ret) {
                break;
            }
        }
        List<Integer> bRet = new ArrayList<>();
        for (int i = 1; i <= 1_000; i++) {
            int ret = (int) (i * b);
            if (ret == B) {
                bRet.add(i);
            }
            if (B < ret) {
                break;
            }
        }

        for (int br : bRet) {
            for (int ar : aRet) {
                if (ar == br) {
                    System.out.println(ar);
                    return;
                }
            }
        }
        System.out.println(-1);
        return;
    }
}