import java.util.Scanner;
import java.math.BigInteger;

public class Main{
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);

        long a = stdIn.nextLong();
        long b = stdIn.nextLong();

        long l1, r1, l2, r2;
        if(a % 2 == 0){
            l1 = 25 * a / 2;
        }else{
            l1 = 25 * a / 2 + 1;
        }
        if((a + 1) % 2 == 0){
            r1 = 25 * (a + 1) / 2 - 1;
        }else{
            r1 = 25 * (a + 1) / 2;
        }
        l2 = 10 * b;
        r2 = 10 * (b + 1) - 1;

        if(r1 < l2 || r2 < l1){
            System.out.println(-1);
        }else{
            System.out.println((l1 < l2) ? l2 : l1);
        }
    }
} import java.util.Scanner; Scanner java.util import java.math.BigInteger; BigInteger java.math public class Main{
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);

        long a = stdIn.nextLong();
        long b = stdIn.nextLong();

        long l1, r1, l2, r2;
        if(a % 2 == 0){
            l1 = 25 * a / 2;
        }else{
            l1 = 25 * a / 2 + 1;
        }
        if((a + 1) % 2 == 0){
            r1 = 25 * (a + 1) / 2 - 1;
        }else{
            r1 = 25 * (a + 1) / 2;
        }
        l2 = 10 * b;
        r2 = 10 * (b + 1) - 1;

        if(r1 < l2 || r2 < l1){
            System.out.println(-1);
        }else{
            System.out.println((l1 < l2) ? l2 : l1);
        }
    }
} Main public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);

        long a = stdIn.nextLong();
        long b = stdIn.nextLong();

        long l1, r1, l2, r2;
        if(a % 2 == 0){
            l1 = 25 * a / 2;
        }else{
            l1 = 25 * a / 2 + 1;
        }
        if((a + 1) % 2 == 0){
            r1 = 25 * (a + 1) / 2 - 1;
        }else{
            r1 = 25 * (a + 1) / 2;
        }
        l2 = 10 * b;
        r2 = 10 * (b + 1) - 1;

        if(r1 < l2 || r2 < l1){
            System.out.println(-1);
        }else{
            System.out.println((l1 < l2) ? l2 : l1);
        }
    } main {
        Scanner stdIn = new Scanner(System.in);

        long a = stdIn.nextLong();
        long b = stdIn.nextLong();

        long l1, r1, l2, r2;
        if(a % 2 == 0){
            l1 = 25 * a / 2;
        }else{
            l1 = 25 * a / 2 + 1;
        }
        if((a + 1) % 2 == 0){
            r1 = 25 * (a + 1) / 2 - 1;
        }else{
            r1 = 25 * (a + 1) / 2;
        }
        l2 = 10 * b;
        r2 = 10 * (b + 1) - 1;

        if(r1 < l2 || r2 < l1){
            System.out.println(-1);
        }else{
            System.out.println((l1 < l2) ? l2 : l1);
        }
    } Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) long a = stdIn.nextLong(); a stdIn.nextLong() stdIn.nextLong stdIn long b = stdIn.nextLong(); b stdIn.nextLong() stdIn.nextLong stdIn long l1 l1 r1 r1 l2 l2 r2; r2 if(a % 2 == 0){
            l1 = 25 * a / 2;
        }else{
            l1 = 25 * a / 2 + 1;
        } a % 2 == 0 a % 2 a 2 0 {
            l1 = 25 * a / 2;
        } l1 = 25 * a / 2 l1 25 * a / 2 25 * a 25 a 2 {
            l1 = 25 * a / 2 + 1;
        } l1 = 25 * a / 2 + 1 l1 25 * a / 2 + 1 25 * a / 2 25 * a 25 a 2 1 if((a + 1) % 2 == 0){
            r1 = 25 * (a + 1) / 2 - 1;
        }else{
            r1 = 25 * (a + 1) / 2;
        } (a + 1) % 2 == 0 (a + 1) % 2 (a + 1) a 1 2 0 {
            r1 = 25 * (a + 1) / 2 - 1;
        } r1 = 25 * (a + 1) / 2 - 1 r1 25 * (a + 1) / 2 - 1 25 * (a + 1) / 2 25 * (a + 1) 25 (a + 1) a 1 2 1 {
            r1 = 25 * (a + 1) / 2;
        } r1 = 25 * (a + 1) / 2 r1 25 * (a + 1) / 2 25 * (a + 1) 25 (a + 1) a 1 2 l2 = 10 * b l2 10 * b 10 b r2 = 10 * (b + 1) - 1 r2 10 * (b + 1) - 1 10 * (b + 1) 10 (b + 1) b 1 1 if(r1 < l2 || r2 < l1){
            System.out.println(-1);
        }else{
            System.out.println((l1 < l2) ? l2 : l1);
        } r1 < l2 || r2 < l1 r1 < l2 r1 l2 r2 < l1 r2 l1 {
            System.out.println(-1);
        } System.out.println(-1) System.out.println System.out System System.out -1 1 {
            System.out.println((l1 < l2) ? l2 : l1);
        } System.out.println((l1 < l2) ? l2 : l1) System.out.println System.out System System.out (l1 < l2) ? l2 : l1 (l1 < l2) l1 l2 l2 l1 String[] args args public class Main{
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);

        long a = stdIn.nextLong();
        long b = stdIn.nextLong();

        long l1, r1, l2, r2;
        if(a % 2 == 0){
            l1 = 25 * a / 2;
        }else{
            l1 = 25 * a / 2 + 1;
        }
        if((a + 1) % 2 == 0){
            r1 = 25 * (a + 1) / 2 - 1;
        }else{
            r1 = 25 * (a + 1) / 2;
        }
        l2 = 10 * b;
        r2 = 10 * (b + 1) - 1;

        if(r1 < l2 || r2 < l1){
            System.out.println(-1);
        }else{
            System.out.println((l1 < l2) ? l2 : l1);
        }
    }
} public class Main{
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);

        long a = stdIn.nextLong();
        long b = stdIn.nextLong();

        long l1, r1, l2, r2;
        if(a % 2 == 0){
            l1 = 25 * a / 2;
        }else{
            l1 = 25 * a / 2 + 1;
        }
        if((a + 1) % 2 == 0){
            r1 = 25 * (a + 1) / 2 - 1;
        }else{
            r1 = 25 * (a + 1) / 2;
        }
        l2 = 10 * b;
        r2 = 10 * (b + 1) - 1;

        if(r1 < l2 || r2 < l1){
            System.out.println(-1);
        }else{
            System.out.println((l1 < l2) ? l2 : l1);
        }
    }
} Main
import java.util.Scanner;
import java.math.BigInteger;

public class Main{
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);

        long a = stdIn.nextLong();
        long b = stdIn.nextLong();

        long l1, r1, l2, r2;
        if(a % 2 == 0){
            l1 = 25 * a / 2;
        }else{
            l1 = 25 * a / 2 + 1;
        }
        if((a + 1) % 2 == 0){
            r1 = 25 * (a + 1) / 2 - 1;
        }else{
            r1 = 25 * (a + 1) / 2;
        }
        l2 = 10 * b;
        r2 = 10 * (b + 1) - 1;

        if(r1 < l2 || r2 < l1){
            System.out.println(-1);
        }else{
            System.out.println((l1 < l2) ? l2 : l1);
        }
    }
}