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();

        double taxA = 0.08;
        double taxB = 0.10;

        int count = 0;
        while (true) {
            double zeinukiA = Math.floor(count * taxA);
            double zeinukiB = Math.floor(count * taxB);
            if (zeinukiA > A || zeinukiB > B) {
                break;
            }
            if (zeinukiA != A) {
                count++;
                continue;
            }
            if (zeinukiB != B) {
                count++;
                continue;
            }
            System.out.println(count);
            return;
        }
        System.out.println(-1);
    }
} 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();

        double taxA = 0.08;
        double taxB = 0.10;

        int count = 0;
        while (true) {
            double zeinukiA = Math.floor(count * taxA);
            double zeinukiB = Math.floor(count * taxB);
            if (zeinukiA > A || zeinukiB > B) {
                break;
            }
            if (zeinukiA != A) {
                count++;
                continue;
            }
            if (zeinukiB != B) {
                count++;
                continue;
            }
            System.out.println(count);
            return;
        }
        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 taxA = 0.08;
        double taxB = 0.10;

        int count = 0;
        while (true) {
            double zeinukiA = Math.floor(count * taxA);
            double zeinukiB = Math.floor(count * taxB);
            if (zeinukiA > A || zeinukiB > B) {
                break;
            }
            if (zeinukiA != A) {
                count++;
                continue;
            }
            if (zeinukiB != B) {
                count++;
                continue;
            }
            System.out.println(count);
            return;
        }
        System.out.println(-1);
    } main {

        Scanner scanner = new Scanner(System.in);
        int A = scanner.nextInt();
        int B = scanner.nextInt();

        double taxA = 0.08;
        double taxB = 0.10;

        int count = 0;
        while (true) {
            double zeinukiA = Math.floor(count * taxA);
            double zeinukiB = Math.floor(count * taxB);
            if (zeinukiA > A || zeinukiB > B) {
                break;
            }
            if (zeinukiA != A) {
                count++;
                continue;
            }
            if (zeinukiB != B) {
                count++;
                continue;
            }
            System.out.println(count);
            return;
        }
        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 taxA = 0.08; taxA 0.08 double taxB = 0.10; taxB 0.10 int count = 0; count 0 while (true) {
            double zeinukiA = Math.floor(count * taxA);
            double zeinukiB = Math.floor(count * taxB);
            if (zeinukiA > A || zeinukiB > B) {
                break;
            }
            if (zeinukiA != A) {
                count++;
                continue;
            }
            if (zeinukiB != B) {
                count++;
                continue;
            }
            System.out.println(count);
            return;
        } true {
            double zeinukiA = Math.floor(count * taxA);
            double zeinukiB = Math.floor(count * taxB);
            if (zeinukiA > A || zeinukiB > B) {
                break;
            }
            if (zeinukiA != A) {
                count++;
                continue;
            }
            if (zeinukiB != B) {
                count++;
                continue;
            }
            System.out.println(count);
            return;
        } double zeinukiA = Math.floor(count * taxA); zeinukiA Math.floor(count * taxA) Math.floor Math count * taxA count taxA double zeinukiB = Math.floor(count * taxB); zeinukiB Math.floor(count * taxB) Math.floor Math count * taxB count taxB if (zeinukiA > A || zeinukiB > B) {
                break;
            } zeinukiA > A || zeinukiB > B zeinukiA > A zeinukiA A zeinukiB > B zeinukiB B {
                break;
            } break; if (zeinukiA != A) {
                count++;
                continue;
            } zeinukiA != A zeinukiA A {
                count++;
                continue;
            } count++ count continue; if (zeinukiB != B) {
                count++;
                continue;
            } zeinukiB != B zeinukiB B {
                count++;
                continue;
            } count++ count continue; System.out.println(count) System.out.println System.out System System.out count return; 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 taxA = 0.08;
        double taxB = 0.10;

        int count = 0;
        while (true) {
            double zeinukiA = Math.floor(count * taxA);
            double zeinukiB = Math.floor(count * taxB);
            if (zeinukiA > A || zeinukiB > B) {
                break;
            }
            if (zeinukiA != A) {
                count++;
                continue;
            }
            if (zeinukiB != B) {
                count++;
                continue;
            }
            System.out.println(count);
            return;
        }
        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 taxA = 0.08;
        double taxB = 0.10;

        int count = 0;
        while (true) {
            double zeinukiA = Math.floor(count * taxA);
            double zeinukiB = Math.floor(count * taxB);
            if (zeinukiA > A || zeinukiB > B) {
                break;
            }
            if (zeinukiA != A) {
                count++;
                continue;
            }
            if (zeinukiB != B) {
                count++;
                continue;
            }
            System.out.println(count);
            return;
        }
        System.out.println(-1);
    }
} 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();

        double taxA = 0.08;
        double taxB = 0.10;

        int count = 0;
        while (true) {
            double zeinukiA = Math.floor(count * taxA);
            double zeinukiB = Math.floor(count * taxB);
            if (zeinukiA > A || zeinukiB > B) {
                break;
            }
            if (zeinukiA != A) {
                count++;
                continue;
            }
            if (zeinukiB != B) {
                count++;
                continue;
            }
            System.out.println(count);
            return;
        }
        System.out.println(-1);
    }
}
