import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int a = scan.nextInt();
    int b = scan.nextInt();

    long c = b*10;
    for (long j=c;j<c+10;j++){
      double gg = j*0.08;
      String t = gg+"";
      String p = a+"";
      boolean found = false;
      for (int l = 0; l<p.length();l++){
        if (t.charAt(l) == p.charAt(l)){
          found = true;
        }
        else{
          found = false;
          break;
        }
      }
      if (found == true){
        System.out.println(j);
        return;
      }
    }
    System.out.println(-1);
  }
} import java.util.*; util.* java public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int a = scan.nextInt();
    int b = scan.nextInt();

    long c = b*10;
    for (long j=c;j<c+10;j++){
      double gg = j*0.08;
      String t = gg+"";
      String p = a+"";
      boolean found = false;
      for (int l = 0; l<p.length();l++){
        if (t.charAt(l) == p.charAt(l)){
          found = true;
        }
        else{
          found = false;
          break;
        }
      }
      if (found == true){
        System.out.println(j);
        return;
      }
    }
    System.out.println(-1);
  }
} Main public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int a = scan.nextInt();
    int b = scan.nextInt();

    long c = b*10;
    for (long j=c;j<c+10;j++){
      double gg = j*0.08;
      String t = gg+"";
      String p = a+"";
      boolean found = false;
      for (int l = 0; l<p.length();l++){
        if (t.charAt(l) == p.charAt(l)){
          found = true;
        }
        else{
          found = false;
          break;
        }
      }
      if (found == true){
        System.out.println(j);
        return;
      }
    }
    System.out.println(-1);
  } main {
    Scanner scan = new Scanner(System.in);
    int a = scan.nextInt();
    int b = scan.nextInt();

    long c = b*10;
    for (long j=c;j<c+10;j++){
      double gg = j*0.08;
      String t = gg+"";
      String p = a+"";
      boolean found = false;
      for (int l = 0; l<p.length();l++){
        if (t.charAt(l) == p.charAt(l)){
          found = true;
        }
        else{
          found = false;
          break;
        }
      }
      if (found == true){
        System.out.println(j);
        return;
      }
    }
    System.out.println(-1);
  } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int a = scan.nextInt(); a scan.nextInt() scan.nextInt scan int b = scan.nextInt(); b scan.nextInt() scan.nextInt scan long c = b*10; c b*10 b 10 for (long j=c;j<c+10;j++){
      double gg = j*0.08;
      String t = gg+"";
      String p = a+"";
      boolean found = false;
      for (int l = 0; l<p.length();l++){
        if (t.charAt(l) == p.charAt(l)){
          found = true;
        }
        else{
          found = false;
          break;
        }
      }
      if (found == true){
        System.out.println(j);
        return;
      }
    } long j=c; long j=c; j c j<c+10 j c+10 c 10 j++ j++ j {
      double gg = j*0.08;
      String t = gg+"";
      String p = a+"";
      boolean found = false;
      for (int l = 0; l<p.length();l++){
        if (t.charAt(l) == p.charAt(l)){
          found = true;
        }
        else{
          found = false;
          break;
        }
      }
      if (found == true){
        System.out.println(j);
        return;
      }
    } {
      double gg = j*0.08;
      String t = gg+"";
      String p = a+"";
      boolean found = false;
      for (int l = 0; l<p.length();l++){
        if (t.charAt(l) == p.charAt(l)){
          found = true;
        }
        else{
          found = false;
          break;
        }
      }
      if (found == true){
        System.out.println(j);
        return;
      }
    } double gg = j*0.08; gg j*0.08 j 0.08 String t = gg+""; t gg+"" gg "" String p = a+""; p a+"" a "" boolean found = false; found false for (int l = 0; l<p.length();l++){
        if (t.charAt(l) == p.charAt(l)){
          found = true;
        }
        else{
          found = false;
          break;
        }
      } int l = 0; int l = 0; l 0 l<p.length() l p.length() p.length p l++ l++ l {
        if (t.charAt(l) == p.charAt(l)){
          found = true;
        }
        else{
          found = false;
          break;
        }
      } {
        if (t.charAt(l) == p.charAt(l)){
          found = true;
        }
        else{
          found = false;
          break;
        }
      } if (t.charAt(l) == p.charAt(l)){
          found = true;
        }
        else{
          found = false;
          break;
        } t.charAt(l) == p.charAt(l) t.charAt(l) t.charAt t l p.charAt(l) p.charAt p l {
          found = true;
        } found = true found true {
          found = false;
          break;
        } found = false found false break; if (found == true){
        System.out.println(j);
        return;
      } found == true found true {
        System.out.println(j);
        return;
      } System.out.println(j) System.out.println System.out System System.out j 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 scan = new Scanner(System.in);
    int a = scan.nextInt();
    int b = scan.nextInt();

    long c = b*10;
    for (long j=c;j<c+10;j++){
      double gg = j*0.08;
      String t = gg+"";
      String p = a+"";
      boolean found = false;
      for (int l = 0; l<p.length();l++){
        if (t.charAt(l) == p.charAt(l)){
          found = true;
        }
        else{
          found = false;
          break;
        }
      }
      if (found == true){
        System.out.println(j);
        return;
      }
    }
    System.out.println(-1);
  }
} public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int a = scan.nextInt();
    int b = scan.nextInt();

    long c = b*10;
    for (long j=c;j<c+10;j++){
      double gg = j*0.08;
      String t = gg+"";
      String p = a+"";
      boolean found = false;
      for (int l = 0; l<p.length();l++){
        if (t.charAt(l) == p.charAt(l)){
          found = true;
        }
        else{
          found = false;
          break;
        }
      }
      if (found == true){
        System.out.println(j);
        return;
      }
    }
    System.out.println(-1);
  }
} Main
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int a = scan.nextInt();
    int b = scan.nextInt();

    long c = b*10;
    for (long j=c;j<c+10;j++){
      double gg = j*0.08;
      String t = gg+"";
      String p = a+"";
      boolean found = false;
      for (int l = 0; l<p.length();l++){
        if (t.charAt(l) == p.charAt(l)){
          found = true;
        }
        else{
          found = false;
          break;
        }
      }
      if (found == true){
        System.out.println(j);
        return;
      }
    }
    System.out.println(-1);
  }
}
