import java.io.*;
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int A,B;
        A = scan.nextInt();
        B = scan.nextInt();
        double tax8=0.08;
        double tax10=0.10;
        int price=-1;
        for(int i=1;i<=1000;i++){
            if((int)(i*tax8+i)-i==A&&(int)(i*tax10+i)-i==B){
                price = i;
                break;
            }
        }
        System.out.println(price);
    }
} import java.io.*; io.* java import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int A,B;
        A = scan.nextInt();
        B = scan.nextInt();
        double tax8=0.08;
        double tax10=0.10;
        int price=-1;
        for(int i=1;i<=1000;i++){
            if((int)(i*tax8+i)-i==A&&(int)(i*tax10+i)-i==B){
                price = i;
                break;
            }
        }
        System.out.println(price);
    }
} Main public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int A,B;
        A = scan.nextInt();
        B = scan.nextInt();
        double tax8=0.08;
        double tax10=0.10;
        int price=-1;
        for(int i=1;i<=1000;i++){
            if((int)(i*tax8+i)-i==A&&(int)(i*tax10+i)-i==B){
                price = i;
                break;
            }
        }
        System.out.println(price);
    } main {
        Scanner scan = new Scanner(System.in);
        int A,B;
        A = scan.nextInt();
        B = scan.nextInt();
        double tax8=0.08;
        double tax10=0.10;
        int price=-1;
        for(int i=1;i<=1000;i++){
            if((int)(i*tax8+i)-i==A&&(int)(i*tax10+i)-i==B){
                price = i;
                break;
            }
        }
        System.out.println(price);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int A A B; B A = scan.nextInt() A scan.nextInt() scan.nextInt scan B = scan.nextInt() B scan.nextInt() scan.nextInt scan double tax8=0.08; tax8 0.08 double tax10=0.10; tax10 0.10 int price=-1; price -1 1 for(int i=1;i<=1000;i++){
            if((int)(i*tax8+i)-i==A&&(int)(i*tax10+i)-i==B){
                price = i;
                break;
            }
        } int i=1; int i=1; i 1 i<=1000 i 1000 i++ i++ i {
            if((int)(i*tax8+i)-i==A&&(int)(i*tax10+i)-i==B){
                price = i;
                break;
            }
        } {
            if((int)(i*tax8+i)-i==A&&(int)(i*tax10+i)-i==B){
                price = i;
                break;
            }
        } if((int)(i*tax8+i)-i==A&&(int)(i*tax10+i)-i==B){
                price = i;
                break;
            } (int)(i*tax8+i)-i==A&&(int)(i*tax10+i)-i==B (int)(i*tax8+i)-i==A (int)(i*tax8+i)-i (int)(i*tax8+i) i*tax8 i tax8 i i A (int)(i*tax10+i)-i==B (int)(i*tax10+i)-i (int)(i*tax10+i) i*tax10 i tax10 i i B {
                price = i;
                break;
            } price = i price i break; System.out.println(price) System.out.println System.out System System.out price String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int A,B;
        A = scan.nextInt();
        B = scan.nextInt();
        double tax8=0.08;
        double tax10=0.10;
        int price=-1;
        for(int i=1;i<=1000;i++){
            if((int)(i*tax8+i)-i==A&&(int)(i*tax10+i)-i==B){
                price = i;
                break;
            }
        }
        System.out.println(price);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int A,B;
        A = scan.nextInt();
        B = scan.nextInt();
        double tax8=0.08;
        double tax10=0.10;
        int price=-1;
        for(int i=1;i<=1000;i++){
            if((int)(i*tax8+i)-i==A&&(int)(i*tax10+i)-i==B){
                price = i;
                break;
            }
        }
        System.out.println(price);
    }
} Main
import java.io.*;
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int A,B;
        A = scan.nextInt();
        B = scan.nextInt();
        double tax8=0.08;
        double tax10=0.10;
        int price=-1;
        for(int i=1;i<=1000;i++){
            if((int)(i*tax8+i)-i==A&&(int)(i*tax10+i)-i==B){
                price = i;
                break;
            }
        }
        System.out.println(price);
    }
}