import java.util.Scanner;

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

		double eight = 0.08;
		double ten = 0.1;

		int start1 = (int)(A / eight);
		int start2 = (int)(B / ten);

		if (start1 == start2) {
			System.out.println(start1);
		}
		else {
			int start = Math.min(start1, start2);

			boolean exists = false;
			for (int i = 1; i < 11; i++) {
				int ans1 = (int)((start + i) * eight);
				int ans2 = (int)((start + i) * ten);
				if (ans1 == A && ans2 == B) {
					System.out.println(start + i);
					exists = true;
					break;
				}
			}
			if (!exists) {
				System.out.println(-1);
			}
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int A = scan.nextInt();
		int B = scan.nextInt();

		double eight = 0.08;
		double ten = 0.1;

		int start1 = (int)(A / eight);
		int start2 = (int)(B / ten);

		if (start1 == start2) {
			System.out.println(start1);
		}
		else {
			int start = Math.min(start1, start2);

			boolean exists = false;
			for (int i = 1; i < 11; i++) {
				int ans1 = (int)((start + i) * eight);
				int ans2 = (int)((start + i) * ten);
				if (ans1 == A && ans2 == B) {
					System.out.println(start + i);
					exists = true;
					break;
				}
			}
			if (!exists) {
				System.out.println(-1);
			}
		}
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int A = scan.nextInt();
		int B = scan.nextInt();

		double eight = 0.08;
		double ten = 0.1;

		int start1 = (int)(A / eight);
		int start2 = (int)(B / ten);

		if (start1 == start2) {
			System.out.println(start1);
		}
		else {
			int start = Math.min(start1, start2);

			boolean exists = false;
			for (int i = 1; i < 11; i++) {
				int ans1 = (int)((start + i) * eight);
				int ans2 = (int)((start + i) * ten);
				if (ans1 == A && ans2 == B) {
					System.out.println(start + i);
					exists = true;
					break;
				}
			}
			if (!exists) {
				System.out.println(-1);
			}
		}
	} main {
		Scanner scan = new Scanner(System.in);
		int A = scan.nextInt();
		int B = scan.nextInt();

		double eight = 0.08;
		double ten = 0.1;

		int start1 = (int)(A / eight);
		int start2 = (int)(B / ten);

		if (start1 == start2) {
			System.out.println(start1);
		}
		else {
			int start = Math.min(start1, start2);

			boolean exists = false;
			for (int i = 1; i < 11; i++) {
				int ans1 = (int)((start + i) * eight);
				int ans2 = (int)((start + i) * ten);
				if (ans1 == A && ans2 == B) {
					System.out.println(start + i);
					exists = true;
					break;
				}
			}
			if (!exists) {
				System.out.println(-1);
			}
		}
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int A = scan.nextInt(); A scan.nextInt() scan.nextInt scan int B = scan.nextInt(); B scan.nextInt() scan.nextInt scan double eight = 0.08; eight 0.08 double ten = 0.1; ten 0.1 int start1 = (int)(A / eight); start1 (int)(A / eight) A eight int start2 = (int)(B / ten); start2 (int)(B / ten) B ten if (start1 == start2) {
			System.out.println(start1);
		}
		else {
			int start = Math.min(start1, start2);

			boolean exists = false;
			for (int i = 1; i < 11; i++) {
				int ans1 = (int)((start + i) * eight);
				int ans2 = (int)((start + i) * ten);
				if (ans1 == A && ans2 == B) {
					System.out.println(start + i);
					exists = true;
					break;
				}
			}
			if (!exists) {
				System.out.println(-1);
			}
		} start1 == start2 start1 start2 {
			System.out.println(start1);
		} System.out.println(start1) System.out.println System.out System System.out start1 {
			int start = Math.min(start1, start2);

			boolean exists = false;
			for (int i = 1; i < 11; i++) {
				int ans1 = (int)((start + i) * eight);
				int ans2 = (int)((start + i) * ten);
				if (ans1 == A && ans2 == B) {
					System.out.println(start + i);
					exists = true;
					break;
				}
			}
			if (!exists) {
				System.out.println(-1);
			}
		} int start = Math.min(start1, start2); start Math.min(start1, start2) Math.min Math start1 start2 boolean exists = false; exists false for (int i = 1; i < 11; i++) {
				int ans1 = (int)((start + i) * eight);
				int ans2 = (int)((start + i) * ten);
				if (ans1 == A && ans2 == B) {
					System.out.println(start + i);
					exists = true;
					break;
				}
			} int i = 1; int i = 1; i 1 i < 11 i 11 i++ i++ i {
				int ans1 = (int)((start + i) * eight);
				int ans2 = (int)((start + i) * ten);
				if (ans1 == A && ans2 == B) {
					System.out.println(start + i);
					exists = true;
					break;
				}
			} {
				int ans1 = (int)((start + i) * eight);
				int ans2 = (int)((start + i) * ten);
				if (ans1 == A && ans2 == B) {
					System.out.println(start + i);
					exists = true;
					break;
				}
			} int ans1 = (int)((start + i) * eight); ans1 (int)((start + i) * eight) (start + i) start i eight int ans2 = (int)((start + i) * ten); ans2 (int)((start + i) * ten) (start + i) start i ten if (ans1 == A && ans2 == B) {
					System.out.println(start + i);
					exists = true;
					break;
				} ans1 == A && ans2 == B ans1 == A ans1 A ans2 == B ans2 B {
					System.out.println(start + i);
					exists = true;
					break;
				} System.out.println(start + i) System.out.println System.out System System.out start + i start i exists = true exists true break; if (!exists) {
				System.out.println(-1);
			} !exists exists {
				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 scan = new Scanner(System.in);
		int A = scan.nextInt();
		int B = scan.nextInt();

		double eight = 0.08;
		double ten = 0.1;

		int start1 = (int)(A / eight);
		int start2 = (int)(B / ten);

		if (start1 == start2) {
			System.out.println(start1);
		}
		else {
			int start = Math.min(start1, start2);

			boolean exists = false;
			for (int i = 1; i < 11; i++) {
				int ans1 = (int)((start + i) * eight);
				int ans2 = (int)((start + i) * ten);
				if (ans1 == A && ans2 == B) {
					System.out.println(start + i);
					exists = true;
					break;
				}
			}
			if (!exists) {
				System.out.println(-1);
			}
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int A = scan.nextInt();
		int B = scan.nextInt();

		double eight = 0.08;
		double ten = 0.1;

		int start1 = (int)(A / eight);
		int start2 = (int)(B / ten);

		if (start1 == start2) {
			System.out.println(start1);
		}
		else {
			int start = Math.min(start1, start2);

			boolean exists = false;
			for (int i = 1; i < 11; i++) {
				int ans1 = (int)((start + i) * eight);
				int ans2 = (int)((start + i) * ten);
				if (ans1 == A && ans2 == B) {
					System.out.println(start + i);
					exists = true;
					break;
				}
			}
			if (!exists) {
				System.out.println(-1);
			}
		}
	}
} Main
import java.util.Scanner;

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

		double eight = 0.08;
		double ten = 0.1;

		int start1 = (int)(A / eight);
		int start2 = (int)(B / ten);

		if (start1 == start2) {
			System.out.println(start1);
		}
		else {
			int start = Math.min(start1, start2);

			boolean exists = false;
			for (int i = 1; i < 11; i++) {
				int ans1 = (int)((start + i) * eight);
				int ans2 = (int)((start + i) * ten);
				if (ans1 == A && ans2 == B) {
					System.out.println(start + i);
					exists = true;
					break;
				}
			}
			if (!exists) {
				System.out.println(-1);
			}
		}
	}
}
