import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		double a = sc.nextInt();
		double b = sc.nextInt();
		double s=a*25/2;
		double t=b*10;
		double min;
		if(s<t){
			min=t;
		}else{
			min=s;
		}
		double max;
		if(s+25/2<t+10){
			max=s+25/2;
		}else{
			max=t+10;
		}
		if(min%1!=0){
			min=min-min%1+1;
		}
		if(max%1!=0){
			max=max-max%1;
		}else{
			max=max-1;
		}

		if(min<=max){
			System.out.println((int)min);
		}else{
			System.out.println(-1);
		}
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		double a = sc.nextInt();
		double b = sc.nextInt();
		double s=a*25/2;
		double t=b*10;
		double min;
		if(s<t){
			min=t;
		}else{
			min=s;
		}
		double max;
		if(s+25/2<t+10){
			max=s+25/2;
		}else{
			max=t+10;
		}
		if(min%1!=0){
			min=min-min%1+1;
		}
		if(max%1!=0){
			max=max-max%1;
		}else{
			max=max-1;
		}

		if(min<=max){
			System.out.println((int)min);
		}else{
			System.out.println(-1);
		}
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		double a = sc.nextInt();
		double b = sc.nextInt();
		double s=a*25/2;
		double t=b*10;
		double min;
		if(s<t){
			min=t;
		}else{
			min=s;
		}
		double max;
		if(s+25/2<t+10){
			max=s+25/2;
		}else{
			max=t+10;
		}
		if(min%1!=0){
			min=min-min%1+1;
		}
		if(max%1!=0){
			max=max-max%1;
		}else{
			max=max-1;
		}

		if(min<=max){
			System.out.println((int)min);
		}else{
			System.out.println(-1);
		}
	} main {
		Scanner sc = new Scanner(System.in);
		double a = sc.nextInt();
		double b = sc.nextInt();
		double s=a*25/2;
		double t=b*10;
		double min;
		if(s<t){
			min=t;
		}else{
			min=s;
		}
		double max;
		if(s+25/2<t+10){
			max=s+25/2;
		}else{
			max=t+10;
		}
		if(min%1!=0){
			min=min-min%1+1;
		}
		if(max%1!=0){
			max=max-max%1;
		}else{
			max=max-1;
		}

		if(min<=max){
			System.out.println((int)min);
		}else{
			System.out.println(-1);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) double a = sc.nextInt(); a sc.nextInt() sc.nextInt sc double b = sc.nextInt(); b sc.nextInt() sc.nextInt sc double s=a*25/2; s a*25/2 a*25 a 25 2 double t=b*10; t b*10 b 10 double min; min if(s<t){
			min=t;
		}else{
			min=s;
		} s<t s t {
			min=t;
		} min=t min t {
			min=s;
		} min=s min s double max; max if(s+25/2<t+10){
			max=s+25/2;
		}else{
			max=t+10;
		} s+25/2<t+10 s+25/2 s 25/2 25 2 t+10 t 10 {
			max=s+25/2;
		} max=s+25/2 max s+25/2 s 25/2 25 2 {
			max=t+10;
		} max=t+10 max t+10 t 10 if(min%1!=0){
			min=min-min%1+1;
		} min%1!=0 min%1 min 1 0 {
			min=min-min%1+1;
		} min=min-min%1+1 min min-min%1+1 min-min%1 min min%1 min 1 1 if(max%1!=0){
			max=max-max%1;
		}else{
			max=max-1;
		} max%1!=0 max%1 max 1 0 {
			max=max-max%1;
		} max=max-max%1 max max-max%1 max max%1 max 1 {
			max=max-1;
		} max=max-1 max max-1 max 1 if(min<=max){
			System.out.println((int)min);
		}else{
			System.out.println(-1);
		} min<=max min max {
			System.out.println((int)min);
		} System.out.println((int)min) System.out.println System.out System System.out (int)min {
			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 sc = new Scanner(System.in);
		double a = sc.nextInt();
		double b = sc.nextInt();
		double s=a*25/2;
		double t=b*10;
		double min;
		if(s<t){
			min=t;
		}else{
			min=s;
		}
		double max;
		if(s+25/2<t+10){
			max=s+25/2;
		}else{
			max=t+10;
		}
		if(min%1!=0){
			min=min-min%1+1;
		}
		if(max%1!=0){
			max=max-max%1;
		}else{
			max=max-1;
		}

		if(min<=max){
			System.out.println((int)min);
		}else{
			System.out.println(-1);
		}
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		double a = sc.nextInt();
		double b = sc.nextInt();
		double s=a*25/2;
		double t=b*10;
		double min;
		if(s<t){
			min=t;
		}else{
			min=s;
		}
		double max;
		if(s+25/2<t+10){
			max=s+25/2;
		}else{
			max=t+10;
		}
		if(min%1!=0){
			min=min-min%1+1;
		}
		if(max%1!=0){
			max=max-max%1;
		}else{
			max=max-1;
		}

		if(min<=max){
			System.out.println((int)min);
		}else{
			System.out.println(-1);
		}
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		double a = sc.nextInt();
		double b = sc.nextInt();
		double s=a*25/2;
		double t=b*10;
		double min;
		if(s<t){
			min=t;
		}else{
			min=s;
		}
		double max;
		if(s+25/2<t+10){
			max=s+25/2;
		}else{
			max=t+10;
		}
		if(min%1!=0){
			min=min-min%1+1;
		}
		if(max%1!=0){
			max=max-max%1;
		}else{
			max=max-1;
		}

		if(min<=max){
			System.out.println((int)min);
		}else{
			System.out.println(-1);
		}
	}
}