import java.util.*;
import java.io.PrintWriter;
import static java.lang.Integer.*;
import static java.lang.Long.*;
import static java.lang.Math.*;
import static java.lang.System.*;

public class Main {
	public static final int MOD = 1000000007;
	public static ArrayList<Integer> list = new ArrayList<>();
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(in);
		int a = parseInt(sc.next());
		int b = parseInt(sc.next());
		sc.close();
		int al = (int) ceil(a*12.5);
		int ah = (int) ceil((a+1)*12.5)-1;
		int bl = b*10;
		int bh = (b+1)*10-1;
//		out.printf("%d,%d,%d,%d%n", al, ah, bl, bh);
		int ans = -1;
		int ml = Math.max(al, bl);
		int mh = Math.min(ah, bh);
		if(ml <= mh) {
			ans = ml;
		}
		out.println(ans);
	}
} import java.util.*; util.* java import java.io.PrintWriter; PrintWriter java.io import static java.lang.Integer.*; import static java.lang.Integer.*; import static java.lang.Integer.*; import static java.lang.Long.*; import static java.lang.Long.*; import static java.lang.Long.*; import static java.lang.Math.*; import static java.lang.Math.*; import static java.lang.Math.*; import static java.lang.System.*; import static java.lang.System.*; import static java.lang.System.*; public class Main {
	public static final int MOD = 1000000007;
	public static ArrayList<Integer> list = new ArrayList<>();
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(in);
		int a = parseInt(sc.next());
		int b = parseInt(sc.next());
		sc.close();
		int al = (int) ceil(a*12.5);
		int ah = (int) ceil((a+1)*12.5)-1;
		int bl = b*10;
		int bh = (b+1)*10-1;
//		out.printf("%d,%d,%d,%d%n", al, ah, bl, bh);
		int ans = -1;
		int ml = Math.max(al, bl);
		int mh = Math.min(ah, bh);
		if(ml <= mh) {
			ans = ml;
		}
		out.println(ans);
	}
} Main public static final int MOD = 1000000007; MOD 1000000007 public static ArrayList<Integer> list = new ArrayList<>(); list new ArrayList<>() public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(in);
		int a = parseInt(sc.next());
		int b = parseInt(sc.next());
		sc.close();
		int al = (int) ceil(a*12.5);
		int ah = (int) ceil((a+1)*12.5)-1;
		int bl = b*10;
		int bh = (b+1)*10-1;
//		out.printf("%d,%d,%d,%d%n", al, ah, bl, bh);
		int ans = -1;
		int ml = Math.max(al, bl);
		int mh = Math.min(ah, bh);
		if(ml <= mh) {
			ans = ml;
		}
		out.println(ans);
	} main {
		int i,j;
		Scanner sc = new Scanner(in);
		int a = parseInt(sc.next());
		int b = parseInt(sc.next());
		sc.close();
		int al = (int) ceil(a*12.5);
		int ah = (int) ceil((a+1)*12.5)-1;
		int bl = b*10;
		int bh = (b+1)*10-1;
//		out.printf("%d,%d,%d,%d%n", al, ah, bl, bh);
		int ans = -1;
		int ml = Math.max(al, bl);
		int mh = Math.min(ah, bh);
		if(ml <= mh) {
			ans = ml;
		}
		out.println(ans);
	} int i i j; j Scanner sc = new Scanner(in); sc new Scanner(in) int a = parseInt(sc.next()); a parseInt(sc.next()) parseInt sc.next() sc.next sc int b = parseInt(sc.next()); b parseInt(sc.next()) parseInt sc.next() sc.next sc sc.close() sc.close sc int al = (int) ceil(a*12.5); al (int) ceil(a*12.5) ceil a*12.5 a 12.5 int ah = (int) ceil((a+1)*12.5)-1; ah (int) ceil((a+1)*12.5)-1 (int) ceil((a+1)*12.5) ceil (a+1)*12.5 (a+1) a 1 12.5 1 int bl = b*10; bl b*10 b 10 int bh = (b+1)*10-1; bh (b+1)*10-1 (b+1)*10 (b+1) b 1 10 1 int ans = -1; ans -1 1 int ml = Math.max(al, bl); ml Math.max(al, bl) Math.max Math al bl int mh = Math.min(ah, bh); mh Math.min(ah, bh) Math.min Math ah bh if(ml <= mh) {
			ans = ml;
		} ml <= mh ml mh {
			ans = ml;
		} ans = ml ans ml out.println(ans) out.println out ans String[] args args public class Main {
	public static final int MOD = 1000000007;
	public static ArrayList<Integer> list = new ArrayList<>();
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(in);
		int a = parseInt(sc.next());
		int b = parseInt(sc.next());
		sc.close();
		int al = (int) ceil(a*12.5);
		int ah = (int) ceil((a+1)*12.5)-1;
		int bl = b*10;
		int bh = (b+1)*10-1;
//		out.printf("%d,%d,%d,%d%n", al, ah, bl, bh);
		int ans = -1;
		int ml = Math.max(al, bl);
		int mh = Math.min(ah, bh);
		if(ml <= mh) {
			ans = ml;
		}
		out.println(ans);
	}
} public class Main {
	public static final int MOD = 1000000007;
	public static ArrayList<Integer> list = new ArrayList<>();
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(in);
		int a = parseInt(sc.next());
		int b = parseInt(sc.next());
		sc.close();
		int al = (int) ceil(a*12.5);
		int ah = (int) ceil((a+1)*12.5)-1;
		int bl = b*10;
		int bh = (b+1)*10-1;
//		out.printf("%d,%d,%d,%d%n", al, ah, bl, bh);
		int ans = -1;
		int ml = Math.max(al, bl);
		int mh = Math.min(ah, bh);
		if(ml <= mh) {
			ans = ml;
		}
		out.println(ans);
	}
} Main
import java.util.*;
import java.io.PrintWriter;
import static java.lang.Integer.*;
import static java.lang.Long.*;
import static java.lang.Math.*;
import static java.lang.System.*;

public class Main {
	public static final int MOD = 1000000007;
	public static ArrayList<Integer> list = new ArrayList<>();
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(in);
		int a = parseInt(sc.next());
		int b = parseInt(sc.next());
		sc.close();
		int al = (int) ceil(a*12.5);
		int ah = (int) ceil((a+1)*12.5)-1;
		int bl = b*10;
		int bh = (b+1)*10-1;
//		out.printf("%d,%d,%d,%d%n", al, ah, bl, bh);
		int ans = -1;
		int ml = Math.max(al, bl);
		int mh = Math.min(ah, bh);
		if(ml <= mh) {
			ans = ml;
		}
		out.println(ans);
	}
}
