import java.util.*;

class Main {
	Scanner sc;
	int A, B;
	
	private void calc() {
		sc = new Scanner(System.in);
		A = sc.nextInt();
		B = sc.nextInt();
		
		System.out.println(sub());
	}
	
	private int sub() {
		double amin = A/0.08;
		double amaxe = (A+1)/0.08;
		
		double bmin = B/0.1;
		double bmaxe = (B+1)/0.1;
		
		if (amin >= bmaxe) return -1;
		if (bmin >= amaxe) return -1;
		
		double min = Math.max(amin, bmin);
		double max = Math.min(amaxe, bmaxe);
		if (min == (int)min) min--;
		if (max == (int)max) max--;
		
		if ( (int)(min+1) > (int)max ) return -1;
		
		return (int)(min+1);
	}

	public static void main(String[] args) {
		new Main().calc();
	}
} import java.util.*; util.* java class Main {
	Scanner sc;
	int A, B;
	
	private void calc() {
		sc = new Scanner(System.in);
		A = sc.nextInt();
		B = sc.nextInt();
		
		System.out.println(sub());
	}
	
	private int sub() {
		double amin = A/0.08;
		double amaxe = (A+1)/0.08;
		
		double bmin = B/0.1;
		double bmaxe = (B+1)/0.1;
		
		if (amin >= bmaxe) return -1;
		if (bmin >= amaxe) return -1;
		
		double min = Math.max(amin, bmin);
		double max = Math.min(amaxe, bmaxe);
		if (min == (int)min) min--;
		if (max == (int)max) max--;
		
		if ( (int)(min+1) > (int)max ) return -1;
		
		return (int)(min+1);
	}

	public static void main(String[] args) {
		new Main().calc();
	}
} Main Scanner sc; sc int A A B; B private void calc() {
		sc = new Scanner(System.in);
		A = sc.nextInt();
		B = sc.nextInt();
		
		System.out.println(sub());
	} calc {
		sc = new Scanner(System.in);
		A = sc.nextInt();
		B = sc.nextInt();
		
		System.out.println(sub());
	} sc = new Scanner(System.in) sc new Scanner(System.in) A = sc.nextInt() A sc.nextInt() sc.nextInt sc B = sc.nextInt() B sc.nextInt() sc.nextInt sc System.out.println(sub()) System.out.println System.out System System.out sub() sub private int sub() {
		double amin = A/0.08;
		double amaxe = (A+1)/0.08;
		
		double bmin = B/0.1;
		double bmaxe = (B+1)/0.1;
		
		if (amin >= bmaxe) return -1;
		if (bmin >= amaxe) return -1;
		
		double min = Math.max(amin, bmin);
		double max = Math.min(amaxe, bmaxe);
		if (min == (int)min) min--;
		if (max == (int)max) max--;
		
		if ( (int)(min+1) > (int)max ) return -1;
		
		return (int)(min+1);
	} sub {
		double amin = A/0.08;
		double amaxe = (A+1)/0.08;
		
		double bmin = B/0.1;
		double bmaxe = (B+1)/0.1;
		
		if (amin >= bmaxe) return -1;
		if (bmin >= amaxe) return -1;
		
		double min = Math.max(amin, bmin);
		double max = Math.min(amaxe, bmaxe);
		if (min == (int)min) min--;
		if (max == (int)max) max--;
		
		if ( (int)(min+1) > (int)max ) return -1;
		
		return (int)(min+1);
	} double amin = A/0.08; amin A/0.08 A 0.08 double amaxe = (A+1)/0.08; amaxe (A+1)/0.08 (A+1) A 1 0.08 double bmin = B/0.1; bmin B/0.1 B 0.1 double bmaxe = (B+1)/0.1; bmaxe (B+1)/0.1 (B+1) B 1 0.1 if (amin >= bmaxe) return -1; amin >= bmaxe amin bmaxe return -1; -1 1 if (bmin >= amaxe) return -1; bmin >= amaxe bmin amaxe return -1; -1 1 double min = Math.max(amin, bmin); min Math.max(amin, bmin) Math.max Math amin bmin double max = Math.min(amaxe, bmaxe); max Math.min(amaxe, bmaxe) Math.min Math amaxe bmaxe if (min == (int)min) min--; min == (int)min min (int)min min-- min if (max == (int)max) max--; max == (int)max max (int)max max-- max if ( (int)(min+1) > (int)max ) return -1; (int)(min+1) > (int)max (int)(min+1) min 1 (int)max return -1; -1 1 return (int)(min+1); (int)(min+1) min 1 public static void main(String[] args) {
		new Main().calc();
	} main {
		new Main().calc();
	} new Main().calc() new Main().calc new Main() String[] args args
import java.util.*;

class Main {
	Scanner sc;
	int A, B;
	
	private void calc() {
		sc = new Scanner(System.in);
		A = sc.nextInt();
		B = sc.nextInt();
		
		System.out.println(sub());
	}
	
	private int sub() {
		double amin = A/0.08;
		double amaxe = (A+1)/0.08;
		
		double bmin = B/0.1;
		double bmaxe = (B+1)/0.1;
		
		if (amin >= bmaxe) return -1;
		if (bmin >= amaxe) return -1;
		
		double min = Math.max(amin, bmin);
		double max = Math.min(amaxe, bmaxe);
		if (min == (int)min) min--;
		if (max == (int)max) max--;
		
		if ( (int)(min+1) > (int)max ) return -1;
		
		return (int)(min+1);
	}

	public static void main(String[] args) {
		new Main().calc();
	}
}
