import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        double aa = a * 100 / 8.0;
        double bb = b * 10;
        double la = (a + 1) * 100 / 8.0;
        double lb = (b + 1) * 10;
        if (aa == bb) {
            System.out.println((int)aa);
        } else if (aa > bb) {
            if (bb <= aa && aa < lb) {
                System.out.println((int)Math.ceil(aa));
            } else {
                System.out.println(-1);
            }
        } else {
            if (aa <= bb && bb < la) {
                System.out.println((int)Math.ceil(bb));
            } else {
                System.out.println(-1);
            }
        }
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        double aa = a * 100 / 8.0;
        double bb = b * 10;
        double la = (a + 1) * 100 / 8.0;
        double lb = (b + 1) * 10;
        if (aa == bb) {
            System.out.println((int)aa);
        } else if (aa > bb) {
            if (bb <= aa && aa < lb) {
                System.out.println((int)Math.ceil(aa));
            } else {
                System.out.println(-1);
            }
        } else {
            if (aa <= bb && bb < la) {
                System.out.println((int)Math.ceil(bb));
            } else {
                System.out.println(-1);
            }
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        double aa = a * 100 / 8.0;
        double bb = b * 10;
        double la = (a + 1) * 100 / 8.0;
        double lb = (b + 1) * 10;
        if (aa == bb) {
            System.out.println((int)aa);
        } else if (aa > bb) {
            if (bb <= aa && aa < lb) {
                System.out.println((int)Math.ceil(aa));
            } else {
                System.out.println(-1);
            }
        } else {
            if (aa <= bb && bb < la) {
                System.out.println((int)Math.ceil(bb));
            } else {
                System.out.println(-1);
            }
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        double aa = a * 100 / 8.0;
        double bb = b * 10;
        double la = (a + 1) * 100 / 8.0;
        double lb = (b + 1) * 10;
        if (aa == bb) {
            System.out.println((int)aa);
        } else if (aa > bb) {
            if (bb <= aa && aa < lb) {
                System.out.println((int)Math.ceil(aa));
            } else {
                System.out.println(-1);
            }
        } else {
            if (aa <= bb && bb < la) {
                System.out.println((int)Math.ceil(bb));
            } else {
                System.out.println(-1);
            }
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = Integer.parseInt(sc.next()); a Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int b = Integer.parseInt(sc.next()); b Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc double aa = a * 100 / 8.0; aa a * 100 / 8.0 a * 100 a 100 8.0 double bb = b * 10; bb b * 10 b 10 double la = (a + 1) * 100 / 8.0; la (a + 1) * 100 / 8.0 (a + 1) * 100 (a + 1) a 1 100 8.0 double lb = (b + 1) * 10; lb (b + 1) * 10 (b + 1) b 1 10 if (aa == bb) {
            System.out.println((int)aa);
        } else if (aa > bb) {
            if (bb <= aa && aa < lb) {
                System.out.println((int)Math.ceil(aa));
            } else {
                System.out.println(-1);
            }
        } else {
            if (aa <= bb && bb < la) {
                System.out.println((int)Math.ceil(bb));
            } else {
                System.out.println(-1);
            }
        } aa == bb aa bb {
            System.out.println((int)aa);
        } System.out.println((int)aa) System.out.println System.out System System.out (int)aa if (aa > bb) {
            if (bb <= aa && aa < lb) {
                System.out.println((int)Math.ceil(aa));
            } else {
                System.out.println(-1);
            }
        } else {
            if (aa <= bb && bb < la) {
                System.out.println((int)Math.ceil(bb));
            } else {
                System.out.println(-1);
            }
        } aa > bb aa bb {
            if (bb <= aa && aa < lb) {
                System.out.println((int)Math.ceil(aa));
            } else {
                System.out.println(-1);
            }
        } if (bb <= aa && aa < lb) {
                System.out.println((int)Math.ceil(aa));
            } else {
                System.out.println(-1);
            } bb <= aa && aa < lb bb <= aa bb aa aa < lb aa lb {
                System.out.println((int)Math.ceil(aa));
            } System.out.println((int)Math.ceil(aa)) System.out.println System.out System System.out (int)Math.ceil(aa) Math.ceil Math aa {
                System.out.println(-1);
            } System.out.println(-1) System.out.println System.out System System.out -1 1 {
            if (aa <= bb && bb < la) {
                System.out.println((int)Math.ceil(bb));
            } else {
                System.out.println(-1);
            }
        } if (aa <= bb && bb < la) {
                System.out.println((int)Math.ceil(bb));
            } else {
                System.out.println(-1);
            } aa <= bb && bb < la aa <= bb aa bb bb < la bb la {
                System.out.println((int)Math.ceil(bb));
            } System.out.println((int)Math.ceil(bb)) System.out.println System.out System System.out (int)Math.ceil(bb) Math.ceil Math bb {
                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);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        double aa = a * 100 / 8.0;
        double bb = b * 10;
        double la = (a + 1) * 100 / 8.0;
        double lb = (b + 1) * 10;
        if (aa == bb) {
            System.out.println((int)aa);
        } else if (aa > bb) {
            if (bb <= aa && aa < lb) {
                System.out.println((int)Math.ceil(aa));
            } else {
                System.out.println(-1);
            }
        } else {
            if (aa <= bb && bb < la) {
                System.out.println((int)Math.ceil(bb));
            } else {
                System.out.println(-1);
            }
        }
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        double aa = a * 100 / 8.0;
        double bb = b * 10;
        double la = (a + 1) * 100 / 8.0;
        double lb = (b + 1) * 10;
        if (aa == bb) {
            System.out.println((int)aa);
        } else if (aa > bb) {
            if (bb <= aa && aa < lb) {
                System.out.println((int)Math.ceil(aa));
            } else {
                System.out.println(-1);
            }
        } else {
            if (aa <= bb && bb < la) {
                System.out.println((int)Math.ceil(bb));
            } else {
                System.out.println(-1);
            }
        }
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        double aa = a * 100 / 8.0;
        double bb = b * 10;
        double la = (a + 1) * 100 / 8.0;
        double lb = (b + 1) * 10;
        if (aa == bb) {
            System.out.println((int)aa);
        } else if (aa > bb) {
            if (bb <= aa && aa < lb) {
                System.out.println((int)Math.ceil(aa));
            } else {
                System.out.println(-1);
            }
        } else {
            if (aa <= bb && bb < la) {
                System.out.println((int)Math.ceil(bb));
            } else {
                System.out.println(-1);
            }
        }
    }
}