

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

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        BigDecimal a = new BigDecimal(scan.next());
        BigDecimal b = new BigDecimal(scan.next());
        scan.close();

        BigDecimal eight = new BigDecimal("0.08");
        BigDecimal ten = new BigDecimal("0.1");

        int aPriceMin = a.divide(eight, 0, RoundingMode.UP).intValue();
        int aPriceMax = a.add(new BigDecimal("1")).divide(eight, 0, RoundingMode.UP).intValue() - 1;

        int bPriceMin = b.divide(ten, 0, RoundingMode.UP).intValue();
        int bPriceMax = b.add(new BigDecimal("1")).divide(ten, 0, RoundingMode.UP).intValue() - 1;

        if (aPriceMax < bPriceMin) {
            System.out.println(-1);
        } else if (aPriceMin < bPriceMin && bPriceMin <= aPriceMax) {
            System.out.println(bPriceMin);
        } else if (aPriceMin <= bPriceMax && bPriceMax < aPriceMax) {
            System.out.println(aPriceMin);
        } else {
            System.out.println(-1);
        }
    }

} import java.math.BigDecimal; BigDecimal java.math import java.math.RoundingMode; RoundingMode java.math import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        BigDecimal a = new BigDecimal(scan.next());
        BigDecimal b = new BigDecimal(scan.next());
        scan.close();

        BigDecimal eight = new BigDecimal("0.08");
        BigDecimal ten = new BigDecimal("0.1");

        int aPriceMin = a.divide(eight, 0, RoundingMode.UP).intValue();
        int aPriceMax = a.add(new BigDecimal("1")).divide(eight, 0, RoundingMode.UP).intValue() - 1;

        int bPriceMin = b.divide(ten, 0, RoundingMode.UP).intValue();
        int bPriceMax = b.add(new BigDecimal("1")).divide(ten, 0, RoundingMode.UP).intValue() - 1;

        if (aPriceMax < bPriceMin) {
            System.out.println(-1);
        } else if (aPriceMin < bPriceMin && bPriceMin <= aPriceMax) {
            System.out.println(bPriceMin);
        } else if (aPriceMin <= bPriceMax && bPriceMax < aPriceMax) {
            System.out.println(aPriceMin);
        } else {
            System.out.println(-1);
        }
    }

} Main public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        BigDecimal a = new BigDecimal(scan.next());
        BigDecimal b = new BigDecimal(scan.next());
        scan.close();

        BigDecimal eight = new BigDecimal("0.08");
        BigDecimal ten = new BigDecimal("0.1");

        int aPriceMin = a.divide(eight, 0, RoundingMode.UP).intValue();
        int aPriceMax = a.add(new BigDecimal("1")).divide(eight, 0, RoundingMode.UP).intValue() - 1;

        int bPriceMin = b.divide(ten, 0, RoundingMode.UP).intValue();
        int bPriceMax = b.add(new BigDecimal("1")).divide(ten, 0, RoundingMode.UP).intValue() - 1;

        if (aPriceMax < bPriceMin) {
            System.out.println(-1);
        } else if (aPriceMin < bPriceMin && bPriceMin <= aPriceMax) {
            System.out.println(bPriceMin);
        } else if (aPriceMin <= bPriceMax && bPriceMax < aPriceMax) {
            System.out.println(aPriceMin);
        } else {
            System.out.println(-1);
        }
    } main {
        Scanner scan = new Scanner(System.in);
        BigDecimal a = new BigDecimal(scan.next());
        BigDecimal b = new BigDecimal(scan.next());
        scan.close();

        BigDecimal eight = new BigDecimal("0.08");
        BigDecimal ten = new BigDecimal("0.1");

        int aPriceMin = a.divide(eight, 0, RoundingMode.UP).intValue();
        int aPriceMax = a.add(new BigDecimal("1")).divide(eight, 0, RoundingMode.UP).intValue() - 1;

        int bPriceMin = b.divide(ten, 0, RoundingMode.UP).intValue();
        int bPriceMax = b.add(new BigDecimal("1")).divide(ten, 0, RoundingMode.UP).intValue() - 1;

        if (aPriceMax < bPriceMin) {
            System.out.println(-1);
        } else if (aPriceMin < bPriceMin && bPriceMin <= aPriceMax) {
            System.out.println(bPriceMin);
        } else if (aPriceMin <= bPriceMax && bPriceMax < aPriceMax) {
            System.out.println(aPriceMin);
        } else {
            System.out.println(-1);
        }
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) BigDecimal a = new BigDecimal(scan.next()); a new BigDecimal(scan.next()) BigDecimal b = new BigDecimal(scan.next()); b new BigDecimal(scan.next()) scan.close() scan.close scan BigDecimal eight = new BigDecimal("0.08"); eight new BigDecimal("0.08") BigDecimal ten = new BigDecimal("0.1"); ten new BigDecimal("0.1") int aPriceMin = a.divide(eight, 0, RoundingMode.UP).intValue(); aPriceMin a.divide(eight, 0, RoundingMode.UP).intValue() a.divide(eight, 0, RoundingMode.UP).intValue a.divide(eight, 0, RoundingMode.UP) a.divide a eight 0 RoundingMode.UP RoundingMode RoundingMode.UP int aPriceMax = a.add(new BigDecimal("1")).divide(eight, 0, RoundingMode.UP).intValue() - 1; aPriceMax a.add(new BigDecimal("1")).divide(eight, 0, RoundingMode.UP).intValue() - 1 a.add(new BigDecimal("1")).divide(eight, 0, RoundingMode.UP).intValue() a.add(new BigDecimal("1")).divide(eight, 0, RoundingMode.UP).intValue a.add(new BigDecimal("1")).divide(eight, 0, RoundingMode.UP) a.add(new BigDecimal("1")).divide a.add(new BigDecimal("1")) a.add a new BigDecimal("1") eight 0 RoundingMode.UP RoundingMode RoundingMode.UP 1 int bPriceMin = b.divide(ten, 0, RoundingMode.UP).intValue(); bPriceMin b.divide(ten, 0, RoundingMode.UP).intValue() b.divide(ten, 0, RoundingMode.UP).intValue b.divide(ten, 0, RoundingMode.UP) b.divide b ten 0 RoundingMode.UP RoundingMode RoundingMode.UP int bPriceMax = b.add(new BigDecimal("1")).divide(ten, 0, RoundingMode.UP).intValue() - 1; bPriceMax b.add(new BigDecimal("1")).divide(ten, 0, RoundingMode.UP).intValue() - 1 b.add(new BigDecimal("1")).divide(ten, 0, RoundingMode.UP).intValue() b.add(new BigDecimal("1")).divide(ten, 0, RoundingMode.UP).intValue b.add(new BigDecimal("1")).divide(ten, 0, RoundingMode.UP) b.add(new BigDecimal("1")).divide b.add(new BigDecimal("1")) b.add b new BigDecimal("1") ten 0 RoundingMode.UP RoundingMode RoundingMode.UP 1 if (aPriceMax < bPriceMin) {
            System.out.println(-1);
        } else if (aPriceMin < bPriceMin && bPriceMin <= aPriceMax) {
            System.out.println(bPriceMin);
        } else if (aPriceMin <= bPriceMax && bPriceMax < aPriceMax) {
            System.out.println(aPriceMin);
        } else {
            System.out.println(-1);
        } aPriceMax < bPriceMin aPriceMax bPriceMin {
            System.out.println(-1);
        } System.out.println(-1) System.out.println System.out System System.out -1 1 if (aPriceMin < bPriceMin && bPriceMin <= aPriceMax) {
            System.out.println(bPriceMin);
        } else if (aPriceMin <= bPriceMax && bPriceMax < aPriceMax) {
            System.out.println(aPriceMin);
        } else {
            System.out.println(-1);
        } aPriceMin < bPriceMin && bPriceMin <= aPriceMax aPriceMin < bPriceMin aPriceMin bPriceMin bPriceMin <= aPriceMax bPriceMin aPriceMax {
            System.out.println(bPriceMin);
        } System.out.println(bPriceMin) System.out.println System.out System System.out bPriceMin if (aPriceMin <= bPriceMax && bPriceMax < aPriceMax) {
            System.out.println(aPriceMin);
        } else {
            System.out.println(-1);
        } aPriceMin <= bPriceMax && bPriceMax < aPriceMax aPriceMin <= bPriceMax aPriceMin bPriceMax bPriceMax < aPriceMax bPriceMax aPriceMax {
            System.out.println(aPriceMin);
        } System.out.println(aPriceMin) System.out.println System.out System System.out aPriceMin {
            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 scan = new Scanner(System.in);
        BigDecimal a = new BigDecimal(scan.next());
        BigDecimal b = new BigDecimal(scan.next());
        scan.close();

        BigDecimal eight = new BigDecimal("0.08");
        BigDecimal ten = new BigDecimal("0.1");

        int aPriceMin = a.divide(eight, 0, RoundingMode.UP).intValue();
        int aPriceMax = a.add(new BigDecimal("1")).divide(eight, 0, RoundingMode.UP).intValue() - 1;

        int bPriceMin = b.divide(ten, 0, RoundingMode.UP).intValue();
        int bPriceMax = b.add(new BigDecimal("1")).divide(ten, 0, RoundingMode.UP).intValue() - 1;

        if (aPriceMax < bPriceMin) {
            System.out.println(-1);
        } else if (aPriceMin < bPriceMin && bPriceMin <= aPriceMax) {
            System.out.println(bPriceMin);
        } else if (aPriceMin <= bPriceMax && bPriceMax < aPriceMax) {
            System.out.println(aPriceMin);
        } else {
            System.out.println(-1);
        }
    }

} public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        BigDecimal a = new BigDecimal(scan.next());
        BigDecimal b = new BigDecimal(scan.next());
        scan.close();

        BigDecimal eight = new BigDecimal("0.08");
        BigDecimal ten = new BigDecimal("0.1");

        int aPriceMin = a.divide(eight, 0, RoundingMode.UP).intValue();
        int aPriceMax = a.add(new BigDecimal("1")).divide(eight, 0, RoundingMode.UP).intValue() - 1;

        int bPriceMin = b.divide(ten, 0, RoundingMode.UP).intValue();
        int bPriceMax = b.add(new BigDecimal("1")).divide(ten, 0, RoundingMode.UP).intValue() - 1;

        if (aPriceMax < bPriceMin) {
            System.out.println(-1);
        } else if (aPriceMin < bPriceMin && bPriceMin <= aPriceMax) {
            System.out.println(bPriceMin);
        } else if (aPriceMin <= bPriceMax && bPriceMax < aPriceMax) {
            System.out.println(aPriceMin);
        } else {
            System.out.println(-1);
        }
    }

} Main


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

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        BigDecimal a = new BigDecimal(scan.next());
        BigDecimal b = new BigDecimal(scan.next());
        scan.close();

        BigDecimal eight = new BigDecimal("0.08");
        BigDecimal ten = new BigDecimal("0.1");

        int aPriceMin = a.divide(eight, 0, RoundingMode.UP).intValue();
        int aPriceMax = a.add(new BigDecimal("1")).divide(eight, 0, RoundingMode.UP).intValue() - 1;

        int bPriceMin = b.divide(ten, 0, RoundingMode.UP).intValue();
        int bPriceMax = b.add(new BigDecimal("1")).divide(ten, 0, RoundingMode.UP).intValue() - 1;

        if (aPriceMax < bPriceMin) {
            System.out.println(-1);
        } else if (aPriceMin < bPriceMin && bPriceMin <= aPriceMax) {
            System.out.println(bPriceMin);
        } else if (aPriceMin <= bPriceMax && bPriceMax < aPriceMax) {
            System.out.println(aPriceMin);
        } else {
            System.out.println(-1);
        }
    }

}
