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();

		for (int ans = Math.min(a * 7, b * 9); ans <= Math.max(a * 13, b * 11); ans++) {
			if ((int)(ans * 0.08) == a && (int)(ans * 0.1) == b) {
				System.out.println(ans);
				return;
			}
		}
		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();

		for (int ans = Math.min(a * 7, b * 9); ans <= Math.max(a * 13, b * 11); ans++) {
			if ((int)(ans * 0.08) == a && (int)(ans * 0.1) == b) {
				System.out.println(ans);
				return;
			}
		}
		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();

		for (int ans = Math.min(a * 7, b * 9); ans <= Math.max(a * 13, b * 11); ans++) {
			if ((int)(ans * 0.08) == a && (int)(ans * 0.1) == b) {
				System.out.println(ans);
				return;
			}
		}
		System.out.println(-1);

	} main {

		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();

		for (int ans = Math.min(a * 7, b * 9); ans <= Math.max(a * 13, b * 11); ans++) {
			if ((int)(ans * 0.08) == a && (int)(ans * 0.1) == b) {
				System.out.println(ans);
				return;
			}
		}
		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 for (int ans = Math.min(a * 7, b * 9); ans <= Math.max(a * 13, b * 11); ans++) {
			if ((int)(ans * 0.08) == a && (int)(ans * 0.1) == b) {
				System.out.println(ans);
				return;
			}
		} int ans = Math.min(a * 7, b * 9); int ans = Math.min(a * 7, b * 9); ans Math.min(a * 7, b * 9) Math.min Math a * 7 a 7 b * 9 b 9 ans <= Math.max(a * 13, b * 11) ans Math.max(a * 13, b * 11) Math.max Math a * 13 a 13 b * 11 b 11 ans++ ans++ ans {
			if ((int)(ans * 0.08) == a && (int)(ans * 0.1) == b) {
				System.out.println(ans);
				return;
			}
		} {
			if ((int)(ans * 0.08) == a && (int)(ans * 0.1) == b) {
				System.out.println(ans);
				return;
			}
		} if ((int)(ans * 0.08) == a && (int)(ans * 0.1) == b) {
				System.out.println(ans);
				return;
			} (int)(ans * 0.08) == a && (int)(ans * 0.1) == b (int)(ans * 0.08) == a (int)(ans * 0.08) ans 0.08 a (int)(ans * 0.1) == b (int)(ans * 0.1) ans 0.1 b {
				System.out.println(ans);
				return;
			} System.out.println(ans) System.out.println System.out System System.out ans return; 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();

		for (int ans = Math.min(a * 7, b * 9); ans <= Math.max(a * 13, b * 11); ans++) {
			if ((int)(ans * 0.08) == a && (int)(ans * 0.1) == b) {
				System.out.println(ans);
				return;
			}
		}
		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();

		for (int ans = Math.min(a * 7, b * 9); ans <= Math.max(a * 13, b * 11); ans++) {
			if ((int)(ans * 0.08) == a && (int)(ans * 0.1) == b) {
				System.out.println(ans);
				return;
			}
		}
		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();

		for (int ans = Math.min(a * 7, b * 9); ans <= Math.max(a * 13, b * 11); ans++) {
			if ((int)(ans * 0.08) == a && (int)(ans * 0.1) == b) {
				System.out.println(ans);
				return;
			}
		}
		System.out.println(-1);

	}

}
