import java.util.*;
import java.math.*;

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

    int minA = (int) Math.ceil(A * 100 / 8d);
    int minB = (int) Math.ceil(B * 100 / 10d);
    int min = Math.max(minA, minB);

    int maxA = (int) Math.ceil((A + 1) * 100 / 8d) - 1;
    int maxB = (int) Math.ceil((B + 1) * 100 / 10d) - 1;
    int max = Math.min(maxA, maxB);


    int ans = (min <= max) ? min : -1;
    System.out.println(ans);
  }
} import java.util.*; util.* java import java.math.*; math.* java public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();
    sc.close();

    int minA = (int) Math.ceil(A * 100 / 8d);
    int minB = (int) Math.ceil(B * 100 / 10d);
    int min = Math.max(minA, minB);

    int maxA = (int) Math.ceil((A + 1) * 100 / 8d) - 1;
    int maxB = (int) Math.ceil((B + 1) * 100 / 10d) - 1;
    int max = Math.min(maxA, maxB);


    int ans = (min <= max) ? min : -1;
    System.out.println(ans);
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();
    sc.close();

    int minA = (int) Math.ceil(A * 100 / 8d);
    int minB = (int) Math.ceil(B * 100 / 10d);
    int min = Math.max(minA, minB);

    int maxA = (int) Math.ceil((A + 1) * 100 / 8d) - 1;
    int maxB = (int) Math.ceil((B + 1) * 100 / 10d) - 1;
    int max = Math.min(maxA, maxB);


    int ans = (min <= max) ? min : -1;
    System.out.println(ans);
  } main {
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();
    sc.close();

    int minA = (int) Math.ceil(A * 100 / 8d);
    int minB = (int) Math.ceil(B * 100 / 10d);
    int min = Math.max(minA, minB);

    int maxA = (int) Math.ceil((A + 1) * 100 / 8d) - 1;
    int maxB = (int) Math.ceil((B + 1) * 100 / 10d) - 1;
    int max = Math.min(maxA, maxB);


    int ans = (min <= max) ? min : -1;
    System.out.println(ans);
  } 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 sc.close() sc.close sc int minA = (int) Math.ceil(A * 100 / 8d); minA (int) Math.ceil(A * 100 / 8d) Math.ceil Math A * 100 / 8d A * 100 A 100 8d int minB = (int) Math.ceil(B * 100 / 10d); minB (int) Math.ceil(B * 100 / 10d) Math.ceil Math B * 100 / 10d B * 100 B 100 10d int min = Math.max(minA, minB); min Math.max(minA, minB) Math.max Math minA minB int maxA = (int) Math.ceil((A + 1) * 100 / 8d) - 1; maxA (int) Math.ceil((A + 1) * 100 / 8d) - 1 (int) Math.ceil((A + 1) * 100 / 8d) Math.ceil Math (A + 1) * 100 / 8d (A + 1) * 100 (A + 1) A 1 100 8d 1 int maxB = (int) Math.ceil((B + 1) * 100 / 10d) - 1; maxB (int) Math.ceil((B + 1) * 100 / 10d) - 1 (int) Math.ceil((B + 1) * 100 / 10d) Math.ceil Math (B + 1) * 100 / 10d (B + 1) * 100 (B + 1) B 1 100 10d 1 int max = Math.min(maxA, maxB); max Math.min(maxA, maxB) Math.min Math maxA maxB int ans = (min <= max) ? min : -1; ans (min <= max) ? min : -1 (min <= max) min max min -1 1 System.out.println(ans) System.out.println System.out System System.out ans 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();
    sc.close();

    int minA = (int) Math.ceil(A * 100 / 8d);
    int minB = (int) Math.ceil(B * 100 / 10d);
    int min = Math.max(minA, minB);

    int maxA = (int) Math.ceil((A + 1) * 100 / 8d) - 1;
    int maxB = (int) Math.ceil((B + 1) * 100 / 10d) - 1;
    int max = Math.min(maxA, maxB);


    int ans = (min <= max) ? min : -1;
    System.out.println(ans);
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();
    sc.close();

    int minA = (int) Math.ceil(A * 100 / 8d);
    int minB = (int) Math.ceil(B * 100 / 10d);
    int min = Math.max(minA, minB);

    int maxA = (int) Math.ceil((A + 1) * 100 / 8d) - 1;
    int maxB = (int) Math.ceil((B + 1) * 100 / 10d) - 1;
    int max = Math.min(maxA, maxB);


    int ans = (min <= max) ? min : -1;
    System.out.println(ans);
  }
} Main
import java.util.*;
import java.math.*;

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

    int minA = (int) Math.ceil(A * 100 / 8d);
    int minB = (int) Math.ceil(B * 100 / 10d);
    int min = Math.max(minA, minB);

    int maxA = (int) Math.ceil((A + 1) * 100 / 8d) - 1;
    int maxB = (int) Math.ceil((B + 1) * 100 / 10d) - 1;
    int max = Math.min(maxA, maxB);


    int ans = (min <= max) ? min : -1;
    System.out.println(ans);
  }
}