import java.util.*;
import java.lang.*;
public class Main {
        public static void main (String[]args){
            Scanner scanner = new Scanner(System.in);
            int A = scanner.nextInt();
            int B = scanner.nextInt();
            double rateA=.08;
            double rateB=.1;
            int potenialA=(int)(A/rateA);
            int potenialB=(int)(B/rateB);
            int smallestStart=0;
            if (potenialA<potenialB){
                smallestStart=potenialB;
            }else{
                smallestStart=potenialA;
            }
            int price=smallestStart;
            boolean answerFound=false;
            boolean possible=false;
            while(answerFound==false){
                if((int)(price*rateA)==A&&(int)(price*rateB)==B){
                    possible=true;
                    answerFound=true;
                    break;
                }
                if((int)(price*rateA)>A||(int)(price*rateB)>B){
                    answerFound=true;
                    break;
                }
                price++;
            }
            if(possible){
                System.out.println(price);
            }else{
                System.out.println(-1);
            }
        }
}


 import java.util.*; util.* java import java.lang.*; lang.* java public class Main {
        public static void main (String[]args){
            Scanner scanner = new Scanner(System.in);
            int A = scanner.nextInt();
            int B = scanner.nextInt();
            double rateA=.08;
            double rateB=.1;
            int potenialA=(int)(A/rateA);
            int potenialB=(int)(B/rateB);
            int smallestStart=0;
            if (potenialA<potenialB){
                smallestStart=potenialB;
            }else{
                smallestStart=potenialA;
            }
            int price=smallestStart;
            boolean answerFound=false;
            boolean possible=false;
            while(answerFound==false){
                if((int)(price*rateA)==A&&(int)(price*rateB)==B){
                    possible=true;
                    answerFound=true;
                    break;
                }
                if((int)(price*rateA)>A||(int)(price*rateB)>B){
                    answerFound=true;
                    break;
                }
                price++;
            }
            if(possible){
                System.out.println(price);
            }else{
                System.out.println(-1);
            }
        }
} Main public static void main (String[]args){
            Scanner scanner = new Scanner(System.in);
            int A = scanner.nextInt();
            int B = scanner.nextInt();
            double rateA=.08;
            double rateB=.1;
            int potenialA=(int)(A/rateA);
            int potenialB=(int)(B/rateB);
            int smallestStart=0;
            if (potenialA<potenialB){
                smallestStart=potenialB;
            }else{
                smallestStart=potenialA;
            }
            int price=smallestStart;
            boolean answerFound=false;
            boolean possible=false;
            while(answerFound==false){
                if((int)(price*rateA)==A&&(int)(price*rateB)==B){
                    possible=true;
                    answerFound=true;
                    break;
                }
                if((int)(price*rateA)>A||(int)(price*rateB)>B){
                    answerFound=true;
                    break;
                }
                price++;
            }
            if(possible){
                System.out.println(price);
            }else{
                System.out.println(-1);
            }
        } main {
            Scanner scanner = new Scanner(System.in);
            int A = scanner.nextInt();
            int B = scanner.nextInt();
            double rateA=.08;
            double rateB=.1;
            int potenialA=(int)(A/rateA);
            int potenialB=(int)(B/rateB);
            int smallestStart=0;
            if (potenialA<potenialB){
                smallestStart=potenialB;
            }else{
                smallestStart=potenialA;
            }
            int price=smallestStart;
            boolean answerFound=false;
            boolean possible=false;
            while(answerFound==false){
                if((int)(price*rateA)==A&&(int)(price*rateB)==B){
                    possible=true;
                    answerFound=true;
                    break;
                }
                if((int)(price*rateA)>A||(int)(price*rateB)>B){
                    answerFound=true;
                    break;
                }
                price++;
            }
            if(possible){
                System.out.println(price);
            }else{
                System.out.println(-1);
            }
        } 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 double rateA=.08; rateA .08 double rateB=.1; rateB .1 int potenialA=(int)(A/rateA); potenialA (int)(A/rateA) A rateA int potenialB=(int)(B/rateB); potenialB (int)(B/rateB) B rateB int smallestStart=0; smallestStart 0 if (potenialA<potenialB){
                smallestStart=potenialB;
            }else{
                smallestStart=potenialA;
            } potenialA<potenialB potenialA potenialB {
                smallestStart=potenialB;
            } smallestStart=potenialB smallestStart potenialB {
                smallestStart=potenialA;
            } smallestStart=potenialA smallestStart potenialA int price=smallestStart; price smallestStart boolean answerFound=false; answerFound false boolean possible=false; possible false while(answerFound==false){
                if((int)(price*rateA)==A&&(int)(price*rateB)==B){
                    possible=true;
                    answerFound=true;
                    break;
                }
                if((int)(price*rateA)>A||(int)(price*rateB)>B){
                    answerFound=true;
                    break;
                }
                price++;
            } answerFound==false answerFound false {
                if((int)(price*rateA)==A&&(int)(price*rateB)==B){
                    possible=true;
                    answerFound=true;
                    break;
                }
                if((int)(price*rateA)>A||(int)(price*rateB)>B){
                    answerFound=true;
                    break;
                }
                price++;
            } if((int)(price*rateA)==A&&(int)(price*rateB)==B){
                    possible=true;
                    answerFound=true;
                    break;
                } (int)(price*rateA)==A&&(int)(price*rateB)==B (int)(price*rateA)==A (int)(price*rateA) price rateA A (int)(price*rateB)==B (int)(price*rateB) price rateB B {
                    possible=true;
                    answerFound=true;
                    break;
                } possible=true possible true answerFound=true answerFound true break; if((int)(price*rateA)>A||(int)(price*rateB)>B){
                    answerFound=true;
                    break;
                } (int)(price*rateA)>A||(int)(price*rateB)>B (int)(price*rateA)>A (int)(price*rateA) price rateA A (int)(price*rateB)>B (int)(price*rateB) price rateB B {
                    answerFound=true;
                    break;
                } answerFound=true answerFound true break; price++ price if(possible){
                System.out.println(price);
            }else{
                System.out.println(-1);
            } possible {
                System.out.println(price);
            } System.out.println(price) System.out.println System.out System System.out price {
                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 scanner = new Scanner(System.in);
            int A = scanner.nextInt();
            int B = scanner.nextInt();
            double rateA=.08;
            double rateB=.1;
            int potenialA=(int)(A/rateA);
            int potenialB=(int)(B/rateB);
            int smallestStart=0;
            if (potenialA<potenialB){
                smallestStart=potenialB;
            }else{
                smallestStart=potenialA;
            }
            int price=smallestStart;
            boolean answerFound=false;
            boolean possible=false;
            while(answerFound==false){
                if((int)(price*rateA)==A&&(int)(price*rateB)==B){
                    possible=true;
                    answerFound=true;
                    break;
                }
                if((int)(price*rateA)>A||(int)(price*rateB)>B){
                    answerFound=true;
                    break;
                }
                price++;
            }
            if(possible){
                System.out.println(price);
            }else{
                System.out.println(-1);
            }
        }
} public class Main {
        public static void main (String[]args){
            Scanner scanner = new Scanner(System.in);
            int A = scanner.nextInt();
            int B = scanner.nextInt();
            double rateA=.08;
            double rateB=.1;
            int potenialA=(int)(A/rateA);
            int potenialB=(int)(B/rateB);
            int smallestStart=0;
            if (potenialA<potenialB){
                smallestStart=potenialB;
            }else{
                smallestStart=potenialA;
            }
            int price=smallestStart;
            boolean answerFound=false;
            boolean possible=false;
            while(answerFound==false){
                if((int)(price*rateA)==A&&(int)(price*rateB)==B){
                    possible=true;
                    answerFound=true;
                    break;
                }
                if((int)(price*rateA)>A||(int)(price*rateB)>B){
                    answerFound=true;
                    break;
                }
                price++;
            }
            if(possible){
                System.out.println(price);
            }else{
                System.out.println(-1);
            }
        }
} Main
import java.util.*;
import java.lang.*;
public class Main {
        public static void main (String[]args){
            Scanner scanner = new Scanner(System.in);
            int A = scanner.nextInt();
            int B = scanner.nextInt();
            double rateA=.08;
            double rateB=.1;
            int potenialA=(int)(A/rateA);
            int potenialB=(int)(B/rateB);
            int smallestStart=0;
            if (potenialA<potenialB){
                smallestStart=potenialB;
            }else{
                smallestStart=potenialA;
            }
            int price=smallestStart;
            boolean answerFound=false;
            boolean possible=false;
            while(answerFound==false){
                if((int)(price*rateA)==A&&(int)(price*rateB)==B){
                    possible=true;
                    answerFound=true;
                    break;
                }
                if((int)(price*rateA)>A||(int)(price*rateB)>B){
                    answerFound=true;
                    break;
                }
                price++;
            }
            if(possible){
                System.out.println(price);
            }else{
                System.out.println(-1);
            }
        }
}



