import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();

		ArrayList<BigDecimal> arrayA = new ArrayList<>(10);
		ArrayList<BigDecimal> arrayB = new ArrayList<>(10);
		for(BigDecimal i = BigDecimal.ZERO; i.compareTo(BigDecimal.ONE) < 0; i = i.add(BigDecimal.valueOf(0.1))) {
			arrayA.add(BigDecimal.valueOf(A).add(i).divide(BigDecimal.valueOf(0.08), RoundingMode.CEILING));
			arrayB.add(BigDecimal.valueOf(B).add(i).divide(BigDecimal.valueOf(0.10), RoundingMode.CEILING));
		}

		int result = Integer.MAX_VALUE;
		for(BigDecimal a : arrayA) {
			for(BigDecimal b : arrayB) {
				if(a.compareTo(b) == 0 && a.intValue() < result) {
					result = a.intValue();
				}
			}
		}
		if(result == Integer.MAX_VALUE) {
			result = -1;
		}
		System.out.println(result);
	}
} import java.math.BigDecimal; BigDecimal java.math import java.math.RoundingMode; RoundingMode java.math import java.util.ArrayList; ArrayList java.util import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();

		ArrayList<BigDecimal> arrayA = new ArrayList<>(10);
		ArrayList<BigDecimal> arrayB = new ArrayList<>(10);
		for(BigDecimal i = BigDecimal.ZERO; i.compareTo(BigDecimal.ONE) < 0; i = i.add(BigDecimal.valueOf(0.1))) {
			arrayA.add(BigDecimal.valueOf(A).add(i).divide(BigDecimal.valueOf(0.08), RoundingMode.CEILING));
			arrayB.add(BigDecimal.valueOf(B).add(i).divide(BigDecimal.valueOf(0.10), RoundingMode.CEILING));
		}

		int result = Integer.MAX_VALUE;
		for(BigDecimal a : arrayA) {
			for(BigDecimal b : arrayB) {
				if(a.compareTo(b) == 0 && a.intValue() < result) {
					result = a.intValue();
				}
			}
		}
		if(result == Integer.MAX_VALUE) {
			result = -1;
		}
		System.out.println(result);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();

		ArrayList<BigDecimal> arrayA = new ArrayList<>(10);
		ArrayList<BigDecimal> arrayB = new ArrayList<>(10);
		for(BigDecimal i = BigDecimal.ZERO; i.compareTo(BigDecimal.ONE) < 0; i = i.add(BigDecimal.valueOf(0.1))) {
			arrayA.add(BigDecimal.valueOf(A).add(i).divide(BigDecimal.valueOf(0.08), RoundingMode.CEILING));
			arrayB.add(BigDecimal.valueOf(B).add(i).divide(BigDecimal.valueOf(0.10), RoundingMode.CEILING));
		}

		int result = Integer.MAX_VALUE;
		for(BigDecimal a : arrayA) {
			for(BigDecimal b : arrayB) {
				if(a.compareTo(b) == 0 && a.intValue() < result) {
					result = a.intValue();
				}
			}
		}
		if(result == Integer.MAX_VALUE) {
			result = -1;
		}
		System.out.println(result);
	} main {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();

		ArrayList<BigDecimal> arrayA = new ArrayList<>(10);
		ArrayList<BigDecimal> arrayB = new ArrayList<>(10);
		for(BigDecimal i = BigDecimal.ZERO; i.compareTo(BigDecimal.ONE) < 0; i = i.add(BigDecimal.valueOf(0.1))) {
			arrayA.add(BigDecimal.valueOf(A).add(i).divide(BigDecimal.valueOf(0.08), RoundingMode.CEILING));
			arrayB.add(BigDecimal.valueOf(B).add(i).divide(BigDecimal.valueOf(0.10), RoundingMode.CEILING));
		}

		int result = Integer.MAX_VALUE;
		for(BigDecimal a : arrayA) {
			for(BigDecimal b : arrayB) {
				if(a.compareTo(b) == 0 && a.intValue() < result) {
					result = a.intValue();
				}
			}
		}
		if(result == Integer.MAX_VALUE) {
			result = -1;
		}
		System.out.println(result);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int A = sc.nextInt(); A sc.nextInt() sc.nextInt sc int B = sc.nextInt(); B sc.nextInt() sc.nextInt sc ArrayList<BigDecimal> arrayA = new ArrayList<>(10); arrayA new ArrayList<>(10) ArrayList<BigDecimal> arrayB = new ArrayList<>(10); arrayB new ArrayList<>(10) for(BigDecimal i = BigDecimal.ZERO; i.compareTo(BigDecimal.ONE) < 0; i = i.add(BigDecimal.valueOf(0.1))) {
			arrayA.add(BigDecimal.valueOf(A).add(i).divide(BigDecimal.valueOf(0.08), RoundingMode.CEILING));
			arrayB.add(BigDecimal.valueOf(B).add(i).divide(BigDecimal.valueOf(0.10), RoundingMode.CEILING));
		} BigDecimal i = BigDecimal.ZERO; BigDecimal i = BigDecimal.ZERO; i BigDecimal.ZERO BigDecimal BigDecimal.ZERO i.compareTo(BigDecimal.ONE) < 0 i.compareTo(BigDecimal.ONE) i.compareTo i BigDecimal.ONE BigDecimal BigDecimal.ONE 0 i = i.add(BigDecimal.valueOf(0.1)) i = i.add(BigDecimal.valueOf(0.1)) i i.add(BigDecimal.valueOf(0.1)) i.add i BigDecimal.valueOf(0.1) BigDecimal.valueOf BigDecimal 0.1 {
			arrayA.add(BigDecimal.valueOf(A).add(i).divide(BigDecimal.valueOf(0.08), RoundingMode.CEILING));
			arrayB.add(BigDecimal.valueOf(B).add(i).divide(BigDecimal.valueOf(0.10), RoundingMode.CEILING));
		} {
			arrayA.add(BigDecimal.valueOf(A).add(i).divide(BigDecimal.valueOf(0.08), RoundingMode.CEILING));
			arrayB.add(BigDecimal.valueOf(B).add(i).divide(BigDecimal.valueOf(0.10), RoundingMode.CEILING));
		} arrayA.add(BigDecimal.valueOf(A).add(i).divide(BigDecimal.valueOf(0.08), RoundingMode.CEILING)) arrayA.add arrayA BigDecimal.valueOf(A).add(i).divide(BigDecimal.valueOf(0.08), RoundingMode.CEILING) BigDecimal.valueOf(A).add(i).divide BigDecimal.valueOf(A).add(i) BigDecimal.valueOf(A).add BigDecimal.valueOf(A) BigDecimal.valueOf BigDecimal A i BigDecimal.valueOf(0.08) BigDecimal.valueOf BigDecimal 0.08 RoundingMode.CEILING RoundingMode RoundingMode.CEILING arrayB.add(BigDecimal.valueOf(B).add(i).divide(BigDecimal.valueOf(0.10), RoundingMode.CEILING)) arrayB.add arrayB BigDecimal.valueOf(B).add(i).divide(BigDecimal.valueOf(0.10), RoundingMode.CEILING) BigDecimal.valueOf(B).add(i).divide BigDecimal.valueOf(B).add(i) BigDecimal.valueOf(B).add BigDecimal.valueOf(B) BigDecimal.valueOf BigDecimal B i BigDecimal.valueOf(0.10) BigDecimal.valueOf BigDecimal 0.10 RoundingMode.CEILING RoundingMode RoundingMode.CEILING int result = Integer.MAX_VALUE; result Integer.MAX_VALUE Integer Integer.MAX_VALUE for(BigDecimal a : arrayA) {
			for(BigDecimal b : arrayB) {
				if(a.compareTo(b) == 0 && a.intValue() < result) {
					result = a.intValue();
				}
			}
		} BigDecimal a arrayA {
			for(BigDecimal b : arrayB) {
				if(a.compareTo(b) == 0 && a.intValue() < result) {
					result = a.intValue();
				}
			}
		} {
			for(BigDecimal b : arrayB) {
				if(a.compareTo(b) == 0 && a.intValue() < result) {
					result = a.intValue();
				}
			}
		} for(BigDecimal b : arrayB) {
				if(a.compareTo(b) == 0 && a.intValue() < result) {
					result = a.intValue();
				}
			} BigDecimal b arrayB {
				if(a.compareTo(b) == 0 && a.intValue() < result) {
					result = a.intValue();
				}
			} {
				if(a.compareTo(b) == 0 && a.intValue() < result) {
					result = a.intValue();
				}
			} if(a.compareTo(b) == 0 && a.intValue() < result) {
					result = a.intValue();
				} a.compareTo(b) == 0 && a.intValue() < result a.compareTo(b) == 0 a.compareTo(b) a.compareTo a b 0 a.intValue() < result a.intValue() a.intValue a result {
					result = a.intValue();
				} result = a.intValue() result a.intValue() a.intValue a if(result == Integer.MAX_VALUE) {
			result = -1;
		} result == Integer.MAX_VALUE result Integer.MAX_VALUE Integer Integer.MAX_VALUE {
			result = -1;
		} result = -1 result -1 1 System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();

		ArrayList<BigDecimal> arrayA = new ArrayList<>(10);
		ArrayList<BigDecimal> arrayB = new ArrayList<>(10);
		for(BigDecimal i = BigDecimal.ZERO; i.compareTo(BigDecimal.ONE) < 0; i = i.add(BigDecimal.valueOf(0.1))) {
			arrayA.add(BigDecimal.valueOf(A).add(i).divide(BigDecimal.valueOf(0.08), RoundingMode.CEILING));
			arrayB.add(BigDecimal.valueOf(B).add(i).divide(BigDecimal.valueOf(0.10), RoundingMode.CEILING));
		}

		int result = Integer.MAX_VALUE;
		for(BigDecimal a : arrayA) {
			for(BigDecimal b : arrayB) {
				if(a.compareTo(b) == 0 && a.intValue() < result) {
					result = a.intValue();
				}
			}
		}
		if(result == Integer.MAX_VALUE) {
			result = -1;
		}
		System.out.println(result);
	}
} public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();

		ArrayList<BigDecimal> arrayA = new ArrayList<>(10);
		ArrayList<BigDecimal> arrayB = new ArrayList<>(10);
		for(BigDecimal i = BigDecimal.ZERO; i.compareTo(BigDecimal.ONE) < 0; i = i.add(BigDecimal.valueOf(0.1))) {
			arrayA.add(BigDecimal.valueOf(A).add(i).divide(BigDecimal.valueOf(0.08), RoundingMode.CEILING));
			arrayB.add(BigDecimal.valueOf(B).add(i).divide(BigDecimal.valueOf(0.10), RoundingMode.CEILING));
		}

		int result = Integer.MAX_VALUE;
		for(BigDecimal a : arrayA) {
			for(BigDecimal b : arrayB) {
				if(a.compareTo(b) == 0 && a.intValue() < result) {
					result = a.intValue();
				}
			}
		}
		if(result == Integer.MAX_VALUE) {
			result = -1;
		}
		System.out.println(result);
	}
} Main
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();

		ArrayList<BigDecimal> arrayA = new ArrayList<>(10);
		ArrayList<BigDecimal> arrayB = new ArrayList<>(10);
		for(BigDecimal i = BigDecimal.ZERO; i.compareTo(BigDecimal.ONE) < 0; i = i.add(BigDecimal.valueOf(0.1))) {
			arrayA.add(BigDecimal.valueOf(A).add(i).divide(BigDecimal.valueOf(0.08), RoundingMode.CEILING));
			arrayB.add(BigDecimal.valueOf(B).add(i).divide(BigDecimal.valueOf(0.10), RoundingMode.CEILING));
		}

		int result = Integer.MAX_VALUE;
		for(BigDecimal a : arrayA) {
			for(BigDecimal b : arrayB) {
				if(a.compareTo(b) == 0 && a.intValue() < result) {
					result = a.intValue();
				}
			}
		}
		if(result == Integer.MAX_VALUE) {
			result = -1;
		}
		System.out.println(result);
	}
}
