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 min = (int) (b / 0.1);
        int max = min;
        int cur = (int) (max * 0.1);
        while (b == cur) {
            max++;
            cur = (int) (max * 0.1);
        }
        boolean hit = false;
        for (int i = min; i < max; i++) {
            int at = (int) (i * 0.08);
            int bt = (int) (i * 0.1);
            if (at == a && bt == b) {
                System.out.println(i);
                hit = true;
                break;
            }
        }
        if (!hit) {
            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 min = (int) (b / 0.1);
        int max = min;
        int cur = (int) (max * 0.1);
        while (b == cur) {
            max++;
            cur = (int) (max * 0.1);
        }
        boolean hit = false;
        for (int i = min; i < max; i++) {
            int at = (int) (i * 0.08);
            int bt = (int) (i * 0.1);
            if (at == a && bt == b) {
                System.out.println(i);
                hit = true;
                break;
            }
        }
        if (!hit) {
            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 min = (int) (b / 0.1);
        int max = min;
        int cur = (int) (max * 0.1);
        while (b == cur) {
            max++;
            cur = (int) (max * 0.1);
        }
        boolean hit = false;
        for (int i = min; i < max; i++) {
            int at = (int) (i * 0.08);
            int bt = (int) (i * 0.1);
            if (at == a && bt == b) {
                System.out.println(i);
                hit = true;
                break;
            }
        }
        if (!hit) {
            System.out.println(-1);
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();

        int min = (int) (b / 0.1);
        int max = min;
        int cur = (int) (max * 0.1);
        while (b == cur) {
            max++;
            cur = (int) (max * 0.1);
        }
        boolean hit = false;
        for (int i = min; i < max; i++) {
            int at = (int) (i * 0.08);
            int bt = (int) (i * 0.1);
            if (at == a && bt == b) {
                System.out.println(i);
                hit = true;
                break;
            }
        }
        if (!hit) {
            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 min = (int) (b / 0.1); min (int) (b / 0.1) b 0.1 int max = min; max min int cur = (int) (max * 0.1); cur (int) (max * 0.1) max 0.1 while (b == cur) {
            max++;
            cur = (int) (max * 0.1);
        } b == cur b cur {
            max++;
            cur = (int) (max * 0.1);
        } max++ max cur = (int) (max * 0.1) cur (int) (max * 0.1) max 0.1 boolean hit = false; hit false for (int i = min; i < max; i++) {
            int at = (int) (i * 0.08);
            int bt = (int) (i * 0.1);
            if (at == a && bt == b) {
                System.out.println(i);
                hit = true;
                break;
            }
        } int i = min; int i = min; i min i < max i max i++ i++ i {
            int at = (int) (i * 0.08);
            int bt = (int) (i * 0.1);
            if (at == a && bt == b) {
                System.out.println(i);
                hit = true;
                break;
            }
        } {
            int at = (int) (i * 0.08);
            int bt = (int) (i * 0.1);
            if (at == a && bt == b) {
                System.out.println(i);
                hit = true;
                break;
            }
        } int at = (int) (i * 0.08); at (int) (i * 0.08) i 0.08 int bt = (int) (i * 0.1); bt (int) (i * 0.1) i 0.1 if (at == a && bt == b) {
                System.out.println(i);
                hit = true;
                break;
            } at == a && bt == b at == a at a bt == b bt b {
                System.out.println(i);
                hit = true;
                break;
            } System.out.println(i) System.out.println System.out System System.out i hit = true hit true break; if (!hit) {
            System.out.println(-1);
        } !hit hit {
            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 min = (int) (b / 0.1);
        int max = min;
        int cur = (int) (max * 0.1);
        while (b == cur) {
            max++;
            cur = (int) (max * 0.1);
        }
        boolean hit = false;
        for (int i = min; i < max; i++) {
            int at = (int) (i * 0.08);
            int bt = (int) (i * 0.1);
            if (at == a && bt == b) {
                System.out.println(i);
                hit = true;
                break;
            }
        }
        if (!hit) {
            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 min = (int) (b / 0.1);
        int max = min;
        int cur = (int) (max * 0.1);
        while (b == cur) {
            max++;
            cur = (int) (max * 0.1);
        }
        boolean hit = false;
        for (int i = min; i < max; i++) {
            int at = (int) (i * 0.08);
            int bt = (int) (i * 0.1);
            if (at == a && bt == b) {
                System.out.println(i);
                hit = true;
                break;
            }
        }
        if (!hit) {
            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 min = (int) (b / 0.1);
        int max = min;
        int cur = (int) (max * 0.1);
        while (b == cur) {
            max++;
            cur = (int) (max * 0.1);
        }
        boolean hit = false;
        for (int i = min; i < max; i++) {
            int at = (int) (i * 0.08);
            int bt = (int) (i * 0.1);
            if (at == a && bt == b) {
                System.out.println(i);
                hit = true;
                break;
            }
        }
        if (!hit) {
            System.out.println(-1);
        }
    }
}