import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int la,ra;
        if((a&1)==0){
            la = a*25/2;
            ra = (a+1)*25/2;
        }else{
            la = a*25/2 + 1;
            ra = (a+1)*25/2-1;
        }

        int lb = b*10;
        int rb = b*10+9;

        if(la>rb || ra<lb) System.out.println(-1);
        else System.out.println(Math.max(la,lb));
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int la,ra;
        if((a&1)==0){
            la = a*25/2;
            ra = (a+1)*25/2;
        }else{
            la = a*25/2 + 1;
            ra = (a+1)*25/2-1;
        }

        int lb = b*10;
        int rb = b*10+9;

        if(la>rb || ra<lb) System.out.println(-1);
        else System.out.println(Math.max(la,lb));
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int la,ra;
        if((a&1)==0){
            la = a*25/2;
            ra = (a+1)*25/2;
        }else{
            la = a*25/2 + 1;
            ra = (a+1)*25/2-1;
        }

        int lb = b*10;
        int rb = b*10+9;

        if(la>rb || ra<lb) System.out.println(-1);
        else System.out.println(Math.max(la,lb));
    } main {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int la,ra;
        if((a&1)==0){
            la = a*25/2;
            ra = (a+1)*25/2;
        }else{
            la = a*25/2 + 1;
            ra = (a+1)*25/2-1;
        }

        int lb = b*10;
        int rb = b*10+9;

        if(la>rb || ra<lb) System.out.println(-1);
        else System.out.println(Math.max(la,lb));
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int a = scanner.nextInt(); a scanner.nextInt() scanner.nextInt scanner int b = scanner.nextInt(); b scanner.nextInt() scanner.nextInt scanner int la la ra; ra if((a&1)==0){
            la = a*25/2;
            ra = (a+1)*25/2;
        }else{
            la = a*25/2 + 1;
            ra = (a+1)*25/2-1;
        } (a&1)==0 (a&1) a 1 0 {
            la = a*25/2;
            ra = (a+1)*25/2;
        } la = a*25/2 la a*25/2 a*25 a 25 2 ra = (a+1)*25/2 ra (a+1)*25/2 (a+1)*25 (a+1) a 1 25 2 {
            la = a*25/2 + 1;
            ra = (a+1)*25/2-1;
        } la = a*25/2 + 1 la a*25/2 + 1 a*25/2 a*25 a 25 2 1 ra = (a+1)*25/2-1 ra (a+1)*25/2-1 (a+1)*25/2 (a+1)*25 (a+1) a 1 25 2 1 int lb = b*10; lb b*10 b 10 int rb = b*10+9; rb b*10+9 b*10 b 10 9 if(la>rb || ra<lb) System.out.println(-1);
        else System.out.println(Math.max(la,lb)); la>rb || ra<lb la>rb la rb ra<lb ra lb System.out.println(-1) System.out.println System.out System System.out -1 1 System.out.println(Math.max(la,lb)) System.out.println System.out System System.out Math.max(la,lb) Math.max Math la lb String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int la,ra;
        if((a&1)==0){
            la = a*25/2;
            ra = (a+1)*25/2;
        }else{
            la = a*25/2 + 1;
            ra = (a+1)*25/2-1;
        }

        int lb = b*10;
        int rb = b*10+9;

        if(la>rb || ra<lb) System.out.println(-1);
        else System.out.println(Math.max(la,lb));
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int la,ra;
        if((a&1)==0){
            la = a*25/2;
            ra = (a+1)*25/2;
        }else{
            la = a*25/2 + 1;
            ra = (a+1)*25/2-1;
        }

        int lb = b*10;
        int rb = b*10+9;

        if(la>rb || ra<lb) System.out.println(-1);
        else System.out.println(Math.max(la,lb));
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int la,ra;
        if((a&1)==0){
            la = a*25/2;
            ra = (a+1)*25/2;
        }else{
            la = a*25/2 + 1;
            ra = (a+1)*25/2-1;
        }

        int lb = b*10;
        int rb = b*10+9;

        if(la>rb || ra<lb) System.out.println(-1);
        else System.out.println(Math.max(la,lb));
    }
}