import java.util.Scanner;
 
public class Main {
	private static Scanner sc = new Scanner(System.in);
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p(long ans) {System.out.println(ans);};
	static String eikomoji[]={"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"};
	public static void main(String[] args) {
	int A =sc.nextInt();
	int B =sc.nextInt();
	int ans=0;
	
	double AA=A/0.08;
	double BB=B/0.10;
	double AAA=(A+1)/0.08;
	double BBB=(B+1)/0.10;
	boolean a=true;
	//p("AA"+AA+"BB"+BB+"AAA"+AAA+"BBB"+BBB);
	//AA~AAAの間であり、BB~BBBの間である数を求める
	for(int i=1;i<=2000;i++) {
		if(AA<=i&&AAA>i&&BB<=i&&BBB>i) {
			System.out.println(i);
			a=false;
			break;
		}
	}
	
	if(a) {
		p(-1);
	}
	
	
	}
} import java.util.Scanner; Scanner java.util public class Main {
	private static Scanner sc = new Scanner(System.in);
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p(long ans) {System.out.println(ans);};
	static String eikomoji[]={"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"};
	public static void main(String[] args) {
	int A =sc.nextInt();
	int B =sc.nextInt();
	int ans=0;
	
	double AA=A/0.08;
	double BB=B/0.10;
	double AAA=(A+1)/0.08;
	double BBB=(B+1)/0.10;
	boolean a=true;
	//p("AA"+AA+"BB"+BB+"AAA"+AAA+"BBB"+BBB);
	//AA~AAAの間であり、BB~BBBの間である数を求める
	for(int i=1;i<=2000;i++) {
		if(AA<=i&&AAA>i&&BB<=i&&BBB>i) {
			System.out.println(i);
			a=false;
			break;
		}
	}
	
	if(a) {
		p(-1);
	}
	
	
	}
} Main private static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) static String eikomoji[]={"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"}; eikomoji {"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"} "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q" "r" "s" "t" "u" "v" "w" "x" "y" "z" static void p(String ans) {System.out.println(ans);} p {System.out.println(ans);} System.out.println(ans) System.out.println System.out System System.out ans String ans ans static void p(int ans) {System.out.println(ans);} p {System.out.println(ans);} System.out.println(ans) System.out.println System.out System System.out ans int ans ans static void p(long ans) {System.out.println(ans);} p {System.out.println(ans);} System.out.println(ans) System.out.println System.out System System.out ans long ans ans public static void main(String[] args) {
	int A =sc.nextInt();
	int B =sc.nextInt();
	int ans=0;
	
	double AA=A/0.08;
	double BB=B/0.10;
	double AAA=(A+1)/0.08;
	double BBB=(B+1)/0.10;
	boolean a=true;
	//p("AA"+AA+"BB"+BB+"AAA"+AAA+"BBB"+BBB);
	//AA~AAAの間であり、BB~BBBの間である数を求める
	for(int i=1;i<=2000;i++) {
		if(AA<=i&&AAA>i&&BB<=i&&BBB>i) {
			System.out.println(i);
			a=false;
			break;
		}
	}
	
	if(a) {
		p(-1);
	}
	
	
	} main {
	int A =sc.nextInt();
	int B =sc.nextInt();
	int ans=0;
	
	double AA=A/0.08;
	double BB=B/0.10;
	double AAA=(A+1)/0.08;
	double BBB=(B+1)/0.10;
	boolean a=true;
	//p("AA"+AA+"BB"+BB+"AAA"+AAA+"BBB"+BBB);
	//AA~AAAの間であり、BB~BBBの間である数を求める
	for(int i=1;i<=2000;i++) {
		if(AA<=i&&AAA>i&&BB<=i&&BBB>i) {
			System.out.println(i);
			a=false;
			break;
		}
	}
	
	if(a) {
		p(-1);
	}
	
	
	} int A =sc.nextInt(); A sc.nextInt() sc.nextInt sc int B =sc.nextInt(); B sc.nextInt() sc.nextInt sc int ans=0; ans 0 double AA=A/0.08; AA A/0.08 A 0.08 double BB=B/0.10; BB B/0.10 B 0.10 double AAA=(A+1)/0.08; AAA (A+1)/0.08 (A+1) A 1 0.08 double BBB=(B+1)/0.10; BBB (B+1)/0.10 (B+1) B 1 0.10 boolean a=true; a true for(int i=1;i<=2000;i++) {
		if(AA<=i&&AAA>i&&BB<=i&&BBB>i) {
			System.out.println(i);
			a=false;
			break;
		}
	} int i=1; int i=1; i 1 i<=2000 i 2000 i++ i++ i {
		if(AA<=i&&AAA>i&&BB<=i&&BBB>i) {
			System.out.println(i);
			a=false;
			break;
		}
	} {
		if(AA<=i&&AAA>i&&BB<=i&&BBB>i) {
			System.out.println(i);
			a=false;
			break;
		}
	} if(AA<=i&&AAA>i&&BB<=i&&BBB>i) {
			System.out.println(i);
			a=false;
			break;
		} AA<=i&&AAA>i&&BB<=i&&BBB>i BB<=i AA<=i&&AAA>i&&BB<=i&&BBB>i AA<=i AA i AAA>i AAA i BB<=i BB i BBB>i BBB i {
			System.out.println(i);
			a=false;
			break;
		} System.out.println(i) System.out.println System.out System System.out i a=false a false break; if(a) {
		p(-1);
	} a {
		p(-1);
	} p(-1) p -1 1 String[] args args public class Main {
	private static Scanner sc = new Scanner(System.in);
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p(long ans) {System.out.println(ans);};
	static String eikomoji[]={"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"};
	public static void main(String[] args) {
	int A =sc.nextInt();
	int B =sc.nextInt();
	int ans=0;
	
	double AA=A/0.08;
	double BB=B/0.10;
	double AAA=(A+1)/0.08;
	double BBB=(B+1)/0.10;
	boolean a=true;
	//p("AA"+AA+"BB"+BB+"AAA"+AAA+"BBB"+BBB);
	//AA~AAAの間であり、BB~BBBの間である数を求める
	for(int i=1;i<=2000;i++) {
		if(AA<=i&&AAA>i&&BB<=i&&BBB>i) {
			System.out.println(i);
			a=false;
			break;
		}
	}
	
	if(a) {
		p(-1);
	}
	
	
	}
} public class Main {
	private static Scanner sc = new Scanner(System.in);
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p(long ans) {System.out.println(ans);};
	static String eikomoji[]={"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"};
	public static void main(String[] args) {
	int A =sc.nextInt();
	int B =sc.nextInt();
	int ans=0;
	
	double AA=A/0.08;
	double BB=B/0.10;
	double AAA=(A+1)/0.08;
	double BBB=(B+1)/0.10;
	boolean a=true;
	//p("AA"+AA+"BB"+BB+"AAA"+AAA+"BBB"+BBB);
	//AA~AAAの間であり、BB~BBBの間である数を求める
	for(int i=1;i<=2000;i++) {
		if(AA<=i&&AAA>i&&BB<=i&&BBB>i) {
			System.out.println(i);
			a=false;
			break;
		}
	}
	
	if(a) {
		p(-1);
	}
	
	
	}
} Main
import java.util.Scanner;
 
public class Main {
	private static Scanner sc = new Scanner(System.in);
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p(long ans) {System.out.println(ans);};
	static String eikomoji[]={"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"};
	public static void main(String[] args) {
	int A =sc.nextInt();
	int B =sc.nextInt();
	int ans=0;
	
	double AA=A/0.08;
	double BB=B/0.10;
	double AAA=(A+1)/0.08;
	double BBB=(B+1)/0.10;
	boolean a=true;
	//p("AA"+AA+"BB"+BB+"AAA"+AAA+"BBB"+BBB);
	//AA~AAAの間であり、BB~BBBの間である数を求める
	for(int i=1;i<=2000;i++) {
		if(AA<=i&&AAA>i&&BB<=i&&BBB>i) {
			System.out.println(i);
			a=false;
			break;
		}
	}
	
	if(a) {
		p(-1);
	}
	
	
	}
}