import 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();
        sc.close();

        int Amin = (A * 25 + 1) / 2;
        int Amax = ((A + 1) * 25 + 1) / 2 - 1;
        int Bmin = (B * 10);
        int Bmax = ((B + 1) * 10) - 1;

        if (Amin <= Bmin && Bmin <= Amax) {
            System.out.println(Bmin);
        } else if (Bmin <= Amin && Amin <= Bmax) {
            System.out.println(Amin);
        } else {
            System.out.println(-1);
        }
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        sc.close();

        int Amin = (A * 25 + 1) / 2;
        int Amax = ((A + 1) * 25 + 1) / 2 - 1;
        int Bmin = (B * 10);
        int Bmax = ((B + 1) * 10) - 1;

        if (Amin <= Bmin && Bmin <= Amax) {
            System.out.println(Bmin);
        } else if (Bmin <= Amin && Amin <= Bmax) {
            System.out.println(Amin);
        } else {
            System.out.println(-1);
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        sc.close();

        int Amin = (A * 25 + 1) / 2;
        int Amax = ((A + 1) * 25 + 1) / 2 - 1;
        int Bmin = (B * 10);
        int Bmax = ((B + 1) * 10) - 1;

        if (Amin <= Bmin && Bmin <= Amax) {
            System.out.println(Bmin);
        } else if (Bmin <= Amin && Amin <= Bmax) {
            System.out.println(Amin);
        } else {
            System.out.println(-1);
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        sc.close();

        int Amin = (A * 25 + 1) / 2;
        int Amax = ((A + 1) * 25 + 1) / 2 - 1;
        int Bmin = (B * 10);
        int Bmax = ((B + 1) * 10) - 1;

        if (Amin <= Bmin && Bmin <= Amax) {
            System.out.println(Bmin);
        } else if (Bmin <= Amin && Amin <= Bmax) {
            System.out.println(Amin);
        } else {
            System.out.println(-1);
        }
    } 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 sc.close() sc.close sc int Amin = (A * 25 + 1) / 2; Amin (A * 25 + 1) / 2 (A * 25 + 1) A * 25 A 25 1 2 int Amax = ((A + 1) * 25 + 1) / 2 - 1; Amax ((A + 1) * 25 + 1) / 2 - 1 ((A + 1) * 25 + 1) / 2 ((A + 1) * 25 + 1) (A + 1) * 25 (A + 1) A 1 25 1 2 1 int Bmin = (B * 10); Bmin (B * 10) B 10 int Bmax = ((B + 1) * 10) - 1; Bmax ((B + 1) * 10) - 1 ((B + 1) * 10) (B + 1) B 1 10 1 if (Amin <= Bmin && Bmin <= Amax) {
            System.out.println(Bmin);
        } else if (Bmin <= Amin && Amin <= Bmax) {
            System.out.println(Amin);
        } else {
            System.out.println(-1);
        } Amin <= Bmin && Bmin <= Amax Amin <= Bmin Amin Bmin Bmin <= Amax Bmin Amax {
            System.out.println(Bmin);
        } System.out.println(Bmin) System.out.println System.out System System.out Bmin if (Bmin <= Amin && Amin <= Bmax) {
            System.out.println(Amin);
        } else {
            System.out.println(-1);
        } Bmin <= Amin && Amin <= Bmax Bmin <= Amin Bmin Amin Amin <= Bmax Amin Bmax {
            System.out.println(Amin);
        } System.out.println(Amin) System.out.println System.out System System.out Amin {
            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 = sc.nextInt();
        int B = sc.nextInt();
        sc.close();

        int Amin = (A * 25 + 1) / 2;
        int Amax = ((A + 1) * 25 + 1) / 2 - 1;
        int Bmin = (B * 10);
        int Bmax = ((B + 1) * 10) - 1;

        if (Amin <= Bmin && Bmin <= Amax) {
            System.out.println(Bmin);
        } else if (Bmin <= Amin && Amin <= Bmax) {
            System.out.println(Amin);
        } else {
            System.out.println(-1);
        }
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        sc.close();

        int Amin = (A * 25 + 1) / 2;
        int Amax = ((A + 1) * 25 + 1) / 2 - 1;
        int Bmin = (B * 10);
        int Bmax = ((B + 1) * 10) - 1;

        if (Amin <= Bmin && Bmin <= Amax) {
            System.out.println(Bmin);
        } else if (Bmin <= Amin && Amin <= Bmax) {
            System.out.println(Amin);
        } else {
            System.out.println(-1);
        }
    }
} Main
import 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();
        sc.close();

        int Amin = (A * 25 + 1) / 2;
        int Amax = ((A + 1) * 25 + 1) / 2 - 1;
        int Bmin = (B * 10);
        int Bmax = ((B + 1) * 10) - 1;

        if (Amin <= Bmin && Bmin <= Amax) {
            System.out.println(Bmin);
        } else if (Bmin <= Amin && Amin <= Bmax) {
            System.out.println(Amin);
        } else {
            System.out.println(-1);
        }
    }
}
