import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner as = new Scanner(System.in);
		//int n = Integer.parseInt(as.next());
		int a = Integer.parseInt(as.next());
		int b = Integer.parseInt(as.next());
		int c = (int)Math.ceil(a*12.5);
		int d = (int)((a+1)*12.5);
		int e = b * 10;
		int f = (b+1)*10;
		if(c<f&&e<d){
			System.out.println(Math.max(c,e));
		}else{
			System.out.println("-1");
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args){
		Scanner as = new Scanner(System.in);
		//int n = Integer.parseInt(as.next());
		int a = Integer.parseInt(as.next());
		int b = Integer.parseInt(as.next());
		int c = (int)Math.ceil(a*12.5);
		int d = (int)((a+1)*12.5);
		int e = b * 10;
		int f = (b+1)*10;
		if(c<f&&e<d){
			System.out.println(Math.max(c,e));
		}else{
			System.out.println("-1");
		}
	}
} Main public static void main(String[] args){
		Scanner as = new Scanner(System.in);
		//int n = Integer.parseInt(as.next());
		int a = Integer.parseInt(as.next());
		int b = Integer.parseInt(as.next());
		int c = (int)Math.ceil(a*12.5);
		int d = (int)((a+1)*12.5);
		int e = b * 10;
		int f = (b+1)*10;
		if(c<f&&e<d){
			System.out.println(Math.max(c,e));
		}else{
			System.out.println("-1");
		}
	} main {
		Scanner as = new Scanner(System.in);
		//int n = Integer.parseInt(as.next());
		int a = Integer.parseInt(as.next());
		int b = Integer.parseInt(as.next());
		int c = (int)Math.ceil(a*12.5);
		int d = (int)((a+1)*12.5);
		int e = b * 10;
		int f = (b+1)*10;
		if(c<f&&e<d){
			System.out.println(Math.max(c,e));
		}else{
			System.out.println("-1");
		}
	} Scanner as = new Scanner(System.in); as new Scanner(System.in) int a = Integer.parseInt(as.next()); a Integer.parseInt(as.next()) Integer.parseInt Integer as.next() as.next as int b = Integer.parseInt(as.next()); b Integer.parseInt(as.next()) Integer.parseInt Integer as.next() as.next as int c = (int)Math.ceil(a*12.5); c (int)Math.ceil(a*12.5) Math.ceil Math a*12.5 a 12.5 int d = (int)((a+1)*12.5); d (int)((a+1)*12.5) (a+1) a 1 12.5 int e = b * 10; e b * 10 b 10 int f = (b+1)*10; f (b+1)*10 (b+1) b 1 10 if(c<f&&e<d){
			System.out.println(Math.max(c,e));
		}else{
			System.out.println("-1");
		} c<f&&e<d c<f c f e<d e d {
			System.out.println(Math.max(c,e));
		} System.out.println(Math.max(c,e)) System.out.println System.out System System.out Math.max(c,e) Math.max Math c e {
			System.out.println("-1");
		} System.out.println("-1") System.out.println System.out System System.out "-1" String[] args args public class Main {
	public static void main(String[] args){
		Scanner as = new Scanner(System.in);
		//int n = Integer.parseInt(as.next());
		int a = Integer.parseInt(as.next());
		int b = Integer.parseInt(as.next());
		int c = (int)Math.ceil(a*12.5);
		int d = (int)((a+1)*12.5);
		int e = b * 10;
		int f = (b+1)*10;
		if(c<f&&e<d){
			System.out.println(Math.max(c,e));
		}else{
			System.out.println("-1");
		}
	}
} public class Main {
	public static void main(String[] args){
		Scanner as = new Scanner(System.in);
		//int n = Integer.parseInt(as.next());
		int a = Integer.parseInt(as.next());
		int b = Integer.parseInt(as.next());
		int c = (int)Math.ceil(a*12.5);
		int d = (int)((a+1)*12.5);
		int e = b * 10;
		int f = (b+1)*10;
		if(c<f&&e<d){
			System.out.println(Math.max(c,e));
		}else{
			System.out.println("-1");
		}
	}
} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner as = new Scanner(System.in);
		//int n = Integer.parseInt(as.next());
		int a = Integer.parseInt(as.next());
		int b = Integer.parseInt(as.next());
		int c = (int)Math.ceil(a*12.5);
		int d = (int)((a+1)*12.5);
		int e = b * 10;
		int f = (b+1)*10;
		if(c<f&&e<d){
			System.out.println(Math.max(c,e));
		}else{
			System.out.println("-1");
		}
	}
}