import java.util.*;

public class Main {
    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();

        HashSet<Integer> set = new HashSet<Integer>();
//        int AStart = 0;
//        if ((A%0.08) == 0){
//            AStart = (int) (A/0.08);
//        } else {
//            AStart = (int) (A/0.08) + 1;
//        }
//        int BStart = 0;
//        if ((B%0.1) == 0){
//            BStart = (int) (B/0.1);
//        } else {
//            BStart = (int) (B/0.1) + 1;
//        }
        for (int i = (int) (Math.ceil(A/0.08)); i < (int) (Math.ceil((A+1)/0.08)); i++){
//            System.out.println(i);
            set.add(i);
        }

        for (int i = (int) (Math.ceil(B/0.1)); i < (int) (Math.ceil((B+1)/0.1)); i++){
//            System.out.println(i);
            if (set.contains(i)){
                System.out.println(i);
                System.exit(0);
            }
        }

        System.out.println("-1");

    }
} import java.util.*; util.* java public class Main {
    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();

        HashSet<Integer> set = new HashSet<Integer>();
//        int AStart = 0;
//        if ((A%0.08) == 0){
//            AStart = (int) (A/0.08);
//        } else {
//            AStart = (int) (A/0.08) + 1;
//        }
//        int BStart = 0;
//        if ((B%0.1) == 0){
//            BStart = (int) (B/0.1);
//        } else {
//            BStart = (int) (B/0.1) + 1;
//        }
        for (int i = (int) (Math.ceil(A/0.08)); i < (int) (Math.ceil((A+1)/0.08)); i++){
//            System.out.println(i);
            set.add(i);
        }

        for (int i = (int) (Math.ceil(B/0.1)); i < (int) (Math.ceil((B+1)/0.1)); i++){
//            System.out.println(i);
            if (set.contains(i)){
                System.out.println(i);
                System.exit(0);
            }
        }

        System.out.println("-1");

    }
} Main public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();

        HashSet<Integer> set = new HashSet<Integer>();
//        int AStart = 0;
//        if ((A%0.08) == 0){
//            AStart = (int) (A/0.08);
//        } else {
//            AStart = (int) (A/0.08) + 1;
//        }
//        int BStart = 0;
//        if ((B%0.1) == 0){
//            BStart = (int) (B/0.1);
//        } else {
//            BStart = (int) (B/0.1) + 1;
//        }
        for (int i = (int) (Math.ceil(A/0.08)); i < (int) (Math.ceil((A+1)/0.08)); i++){
//            System.out.println(i);
            set.add(i);
        }

        for (int i = (int) (Math.ceil(B/0.1)); i < (int) (Math.ceil((B+1)/0.1)); i++){
//            System.out.println(i);
            if (set.contains(i)){
                System.out.println(i);
                System.exit(0);
            }
        }

        System.out.println("-1");

    } main {
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();

        HashSet<Integer> set = new HashSet<Integer>();
//        int AStart = 0;
//        if ((A%0.08) == 0){
//            AStart = (int) (A/0.08);
//        } else {
//            AStart = (int) (A/0.08) + 1;
//        }
//        int BStart = 0;
//        if ((B%0.1) == 0){
//            BStart = (int) (B/0.1);
//        } else {
//            BStart = (int) (B/0.1) + 1;
//        }
        for (int i = (int) (Math.ceil(A/0.08)); i < (int) (Math.ceil((A+1)/0.08)); i++){
//            System.out.println(i);
            set.add(i);
        }

        for (int i = (int) (Math.ceil(B/0.1)); i < (int) (Math.ceil((B+1)/0.1)); i++){
//            System.out.println(i);
            if (set.contains(i)){
                System.out.println(i);
                System.exit(0);
            }
        }

        System.out.println("-1");

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int A = sc.nextInt(); A sc.nextInt() sc.nextInt sc int B = sc.nextInt(); B sc.nextInt() sc.nextInt sc HashSet<Integer> set = new HashSet<Integer>(); set new HashSet<Integer>() for (int i = (int) (Math.ceil(A/0.08)); i < (int) (Math.ceil((A+1)/0.08)); i++){
//            System.out.println(i);
            set.add(i);
        } int i = (int) (Math.ceil(A/0.08)); int i = (int) (Math.ceil(A/0.08)); i (int) (Math.ceil(A/0.08)) Math.ceil Math A/0.08 A 0.08 i < (int) (Math.ceil((A+1)/0.08)) i (int) (Math.ceil((A+1)/0.08)) Math.ceil Math (A+1)/0.08 (A+1) A 1 0.08 i++ i++ i {
//            System.out.println(i);
            set.add(i);
        } {
//            System.out.println(i);
            set.add(i);
        } set.add(i) set.add set i for (int i = (int) (Math.ceil(B/0.1)); i < (int) (Math.ceil((B+1)/0.1)); i++){
//            System.out.println(i);
            if (set.contains(i)){
                System.out.println(i);
                System.exit(0);
            }
        } int i = (int) (Math.ceil(B/0.1)); int i = (int) (Math.ceil(B/0.1)); i (int) (Math.ceil(B/0.1)) Math.ceil Math B/0.1 B 0.1 i < (int) (Math.ceil((B+1)/0.1)) i (int) (Math.ceil((B+1)/0.1)) Math.ceil Math (B+1)/0.1 (B+1) B 1 0.1 i++ i++ i {
//            System.out.println(i);
            if (set.contains(i)){
                System.out.println(i);
                System.exit(0);
            }
        } {
//            System.out.println(i);
            if (set.contains(i)){
                System.out.println(i);
                System.exit(0);
            }
        } if (set.contains(i)){
                System.out.println(i);
                System.exit(0);
            } set.contains(i) set.contains set i {
                System.out.println(i);
                System.exit(0);
            } System.out.println(i) System.out.println System.out System System.out i System.exit(0) System.exit System 0 System.out.println("-1") System.out.println System.out System System.out "-1" String[] args args public class Main {
    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();

        HashSet<Integer> set = new HashSet<Integer>();
//        int AStart = 0;
//        if ((A%0.08) == 0){
//            AStart = (int) (A/0.08);
//        } else {
//            AStart = (int) (A/0.08) + 1;
//        }
//        int BStart = 0;
//        if ((B%0.1) == 0){
//            BStart = (int) (B/0.1);
//        } else {
//            BStart = (int) (B/0.1) + 1;
//        }
        for (int i = (int) (Math.ceil(A/0.08)); i < (int) (Math.ceil((A+1)/0.08)); i++){
//            System.out.println(i);
            set.add(i);
        }

        for (int i = (int) (Math.ceil(B/0.1)); i < (int) (Math.ceil((B+1)/0.1)); i++){
//            System.out.println(i);
            if (set.contains(i)){
                System.out.println(i);
                System.exit(0);
            }
        }

        System.out.println("-1");

    }
} public class Main {
    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();

        HashSet<Integer> set = new HashSet<Integer>();
//        int AStart = 0;
//        if ((A%0.08) == 0){
//            AStart = (int) (A/0.08);
//        } else {
//            AStart = (int) (A/0.08) + 1;
//        }
//        int BStart = 0;
//        if ((B%0.1) == 0){
//            BStart = (int) (B/0.1);
//        } else {
//            BStart = (int) (B/0.1) + 1;
//        }
        for (int i = (int) (Math.ceil(A/0.08)); i < (int) (Math.ceil((A+1)/0.08)); i++){
//            System.out.println(i);
            set.add(i);
        }

        for (int i = (int) (Math.ceil(B/0.1)); i < (int) (Math.ceil((B+1)/0.1)); i++){
//            System.out.println(i);
            if (set.contains(i)){
                System.out.println(i);
                System.exit(0);
            }
        }

        System.out.println("-1");

    }
} Main
import java.util.*;

public class Main {
    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();

        HashSet<Integer> set = new HashSet<Integer>();
//        int AStart = 0;
//        if ((A%0.08) == 0){
//            AStart = (int) (A/0.08);
//        } else {
//            AStart = (int) (A/0.08) + 1;
//        }
//        int BStart = 0;
//        if ((B%0.1) == 0){
//            BStart = (int) (B/0.1);
//        } else {
//            BStart = (int) (B/0.1) + 1;
//        }
        for (int i = (int) (Math.ceil(A/0.08)); i < (int) (Math.ceil((A+1)/0.08)); i++){
//            System.out.println(i);
            set.add(i);
        }

        for (int i = (int) (Math.ceil(B/0.1)); i < (int) (Math.ceil((B+1)/0.1)); i++){
//            System.out.println(i);
            if (set.contains(i)){
                System.out.println(i);
                System.exit(0);
            }
        }

        System.out.println("-1");

    }
}