import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sn = new Scanner(System.in);
		int A = Integer.parseInt(sn.next());
		int B = Integer.parseInt(sn.next());
		sn.close();

		double hati;
		double juu;

		hati = A / 0.08;
		juu = B / 0.1;

		double kekka;

		if(hati == juu) {
			if(hati == 0) {
				kekka = -1;
			}else {
				kekka = hati;
			}
		}else if(hati < juu) {
			if((A+1) / 0.08 > juu) {
				kekka = juu;
			}else {
				kekka = -1;
			}
		}else {
			if((B+1) / 0.1 > hati) {
				kekka = hati;
			}else {
				kekka = -1;
			}

		}

		System.out.println((int)Math.round(kekka));

	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

		Scanner sn = new Scanner(System.in);
		int A = Integer.parseInt(sn.next());
		int B = Integer.parseInt(sn.next());
		sn.close();

		double hati;
		double juu;

		hati = A / 0.08;
		juu = B / 0.1;

		double kekka;

		if(hati == juu) {
			if(hati == 0) {
				kekka = -1;
			}else {
				kekka = hati;
			}
		}else if(hati < juu) {
			if((A+1) / 0.08 > juu) {
				kekka = juu;
			}else {
				kekka = -1;
			}
		}else {
			if((B+1) / 0.1 > hati) {
				kekka = hati;
			}else {
				kekka = -1;
			}

		}

		System.out.println((int)Math.round(kekka));

	}

} Main public static void main(String[] args) {

		Scanner sn = new Scanner(System.in);
		int A = Integer.parseInt(sn.next());
		int B = Integer.parseInt(sn.next());
		sn.close();

		double hati;
		double juu;

		hati = A / 0.08;
		juu = B / 0.1;

		double kekka;

		if(hati == juu) {
			if(hati == 0) {
				kekka = -1;
			}else {
				kekka = hati;
			}
		}else if(hati < juu) {
			if((A+1) / 0.08 > juu) {
				kekka = juu;
			}else {
				kekka = -1;
			}
		}else {
			if((B+1) / 0.1 > hati) {
				kekka = hati;
			}else {
				kekka = -1;
			}

		}

		System.out.println((int)Math.round(kekka));

	} main {

		Scanner sn = new Scanner(System.in);
		int A = Integer.parseInt(sn.next());
		int B = Integer.parseInt(sn.next());
		sn.close();

		double hati;
		double juu;

		hati = A / 0.08;
		juu = B / 0.1;

		double kekka;

		if(hati == juu) {
			if(hati == 0) {
				kekka = -1;
			}else {
				kekka = hati;
			}
		}else if(hati < juu) {
			if((A+1) / 0.08 > juu) {
				kekka = juu;
			}else {
				kekka = -1;
			}
		}else {
			if((B+1) / 0.1 > hati) {
				kekka = hati;
			}else {
				kekka = -1;
			}

		}

		System.out.println((int)Math.round(kekka));

	} Scanner sn = new Scanner(System.in); sn new Scanner(System.in) int A = Integer.parseInt(sn.next()); A Integer.parseInt(sn.next()) Integer.parseInt Integer sn.next() sn.next sn int B = Integer.parseInt(sn.next()); B Integer.parseInt(sn.next()) Integer.parseInt Integer sn.next() sn.next sn sn.close() sn.close sn double hati; hati double juu; juu hati = A / 0.08 hati A / 0.08 A 0.08 juu = B / 0.1 juu B / 0.1 B 0.1 double kekka; kekka if(hati == juu) {
			if(hati == 0) {
				kekka = -1;
			}else {
				kekka = hati;
			}
		}else if(hati < juu) {
			if((A+1) / 0.08 > juu) {
				kekka = juu;
			}else {
				kekka = -1;
			}
		}else {
			if((B+1) / 0.1 > hati) {
				kekka = hati;
			}else {
				kekka = -1;
			}

		} hati == juu hati juu {
			if(hati == 0) {
				kekka = -1;
			}else {
				kekka = hati;
			}
		} if(hati == 0) {
				kekka = -1;
			}else {
				kekka = hati;
			} hati == 0 hati 0 {
				kekka = -1;
			} kekka = -1 kekka -1 1 {
				kekka = hati;
			} kekka = hati kekka hati if(hati < juu) {
			if((A+1) / 0.08 > juu) {
				kekka = juu;
			}else {
				kekka = -1;
			}
		}else {
			if((B+1) / 0.1 > hati) {
				kekka = hati;
			}else {
				kekka = -1;
			}

		} hati < juu hati juu {
			if((A+1) / 0.08 > juu) {
				kekka = juu;
			}else {
				kekka = -1;
			}
		} if((A+1) / 0.08 > juu) {
				kekka = juu;
			}else {
				kekka = -1;
			} (A+1) / 0.08 > juu (A+1) / 0.08 (A+1) A 1 0.08 juu {
				kekka = juu;
			} kekka = juu kekka juu {
				kekka = -1;
			} kekka = -1 kekka -1 1 {
			if((B+1) / 0.1 > hati) {
				kekka = hati;
			}else {
				kekka = -1;
			}

		} if((B+1) / 0.1 > hati) {
				kekka = hati;
			}else {
				kekka = -1;
			} (B+1) / 0.1 > hati (B+1) / 0.1 (B+1) B 1 0.1 hati {
				kekka = hati;
			} kekka = hati kekka hati {
				kekka = -1;
			} kekka = -1 kekka -1 1 System.out.println((int)Math.round(kekka)) System.out.println System.out System System.out (int)Math.round(kekka) Math.round Math kekka String[] args args public class Main {

	public static void main(String[] args) {

		Scanner sn = new Scanner(System.in);
		int A = Integer.parseInt(sn.next());
		int B = Integer.parseInt(sn.next());
		sn.close();

		double hati;
		double juu;

		hati = A / 0.08;
		juu = B / 0.1;

		double kekka;

		if(hati == juu) {
			if(hati == 0) {
				kekka = -1;
			}else {
				kekka = hati;
			}
		}else if(hati < juu) {
			if((A+1) / 0.08 > juu) {
				kekka = juu;
			}else {
				kekka = -1;
			}
		}else {
			if((B+1) / 0.1 > hati) {
				kekka = hati;
			}else {
				kekka = -1;
			}

		}

		System.out.println((int)Math.round(kekka));

	}

} public class Main {

	public static void main(String[] args) {

		Scanner sn = new Scanner(System.in);
		int A = Integer.parseInt(sn.next());
		int B = Integer.parseInt(sn.next());
		sn.close();

		double hati;
		double juu;

		hati = A / 0.08;
		juu = B / 0.1;

		double kekka;

		if(hati == juu) {
			if(hati == 0) {
				kekka = -1;
			}else {
				kekka = hati;
			}
		}else if(hati < juu) {
			if((A+1) / 0.08 > juu) {
				kekka = juu;
			}else {
				kekka = -1;
			}
		}else {
			if((B+1) / 0.1 > hati) {
				kekka = hati;
			}else {
				kekka = -1;
			}

		}

		System.out.println((int)Math.round(kekka));

	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sn = new Scanner(System.in);
		int A = Integer.parseInt(sn.next());
		int B = Integer.parseInt(sn.next());
		sn.close();

		double hati;
		double juu;

		hati = A / 0.08;
		juu = B / 0.1;

		double kekka;

		if(hati == juu) {
			if(hati == 0) {
				kekka = -1;
			}else {
				kekka = hati;
			}
		}else if(hati < juu) {
			if((A+1) / 0.08 > juu) {
				kekka = juu;
			}else {
				kekka = -1;
			}
		}else {
			if((B+1) / 0.1 > hati) {
				kekka = hati;
			}else {
				kekka = -1;
			}

		}

		System.out.println((int)Math.round(kekka));

	}

}