import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int s = a * 100 / 8, t = b * 10;
        if((double)a * 100 / 8 % 1 > 0) s++;
        if(s >= t && (s / 10) == b){
            System.out.println(s);
        }else if(t >= s && (t * 8 /100) == a){
            System.out.println(t);
        }else{
            System.out.println(-1);
        }
    }
} import java.util.Scanner; Scanner 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();
        int s = a * 100 / 8, t = b * 10;
        if((double)a * 100 / 8 % 1 > 0) s++;
        if(s >= t && (s / 10) == b){
            System.out.println(s);
        }else if(t >= s && (t * 8 /100) == a){
            System.out.println(t);
        }else{
            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();
        int s = a * 100 / 8, t = b * 10;
        if((double)a * 100 / 8 % 1 > 0) s++;
        if(s >= t && (s / 10) == b){
            System.out.println(s);
        }else if(t >= s && (t * 8 /100) == a){
            System.out.println(t);
        }else{
            System.out.println(-1);
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int s = a * 100 / 8, t = b * 10;
        if((double)a * 100 / 8 % 1 > 0) s++;
        if(s >= t && (s / 10) == b){
            System.out.println(s);
        }else if(t >= s && (t * 8 /100) == a){
            System.out.println(t);
        }else{
            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 int s = a * 100 / 8 s a * 100 / 8 a * 100 a 100 8 t = b * 10; t b * 10 b 10 if((double)a * 100 / 8 % 1 > 0) s++; (double)a * 100 / 8 % 1 > 0 (double)a * 100 / 8 % 1 (double)a * 100 / 8 (double)a * 100 (double)a 100 8 1 0 s++ s if(s >= t && (s / 10) == b){
            System.out.println(s);
        }else if(t >= s && (t * 8 /100) == a){
            System.out.println(t);
        }else{
            System.out.println(-1);
        } s >= t && (s / 10) == b s >= t s t (s / 10) == b (s / 10) s 10 b {
            System.out.println(s);
        } System.out.println(s) System.out.println System.out System System.out s if(t >= s && (t * 8 /100) == a){
            System.out.println(t);
        }else{
            System.out.println(-1);
        } t >= s && (t * 8 /100) == a t >= s t s (t * 8 /100) == a (t * 8 /100) t * 8 t 8 100 a {
            System.out.println(t);
        } System.out.println(t) System.out.println System.out System System.out t {
            System.out.println(-1);
        } System.out.println(-1) System.out.println System.out System System.out -1 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();
        int s = a * 100 / 8, t = b * 10;
        if((double)a * 100 / 8 % 1 > 0) s++;
        if(s >= t && (s / 10) == b){
            System.out.println(s);
        }else if(t >= s && (t * 8 /100) == a){
            System.out.println(t);
        }else{
            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();
        int s = a * 100 / 8, t = b * 10;
        if((double)a * 100 / 8 % 1 > 0) s++;
        if(s >= t && (s / 10) == b){
            System.out.println(s);
        }else if(t >= s && (t * 8 /100) == a){
            System.out.println(t);
        }else{
            System.out.println(-1);
        }
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int s = a * 100 / 8, t = b * 10;
        if((double)a * 100 / 8 % 1 > 0) s++;
        if(s >= t && (s / 10) == b){
            System.out.println(s);
        }else if(t >= s && (t * 8 /100) == a){
            System.out.println(t);
        }else{
            System.out.println(-1);
        }
    }
}
