import java.util.*;
public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    // 整数の入力

    int a = sc.nextInt();
    int b = sc.nextInt();

    int p = a*100 / 8;
    if (( a*100 % 8) !=0) {
      p = p+1;
    }
      //int q = b*10;
    int q = b*10;
    //出力
    if ( b == p/10 ) {
      System.out.println( p );
    } else if ( a == q*10/125) {
       System.out.println( q );
    }else{
      System.out.println(-1);
    }
    
    
  }
}

 import java.util.*; util.* java public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    // 整数の入力

    int a = sc.nextInt();
    int b = sc.nextInt();

    int p = a*100 / 8;
    if (( a*100 % 8) !=0) {
      p = p+1;
    }
      //int q = b*10;
    int q = b*10;
    //出力
    if ( b == p/10 ) {
      System.out.println( p );
    } else if ( a == q*10/125) {
       System.out.println( q );
    }else{
      System.out.println(-1);
    }
    
    
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    // 整数の入力

    int a = sc.nextInt();
    int b = sc.nextInt();

    int p = a*100 / 8;
    if (( a*100 % 8) !=0) {
      p = p+1;
    }
      //int q = b*10;
    int q = b*10;
    //出力
    if ( b == p/10 ) {
      System.out.println( p );
    } else if ( a == q*10/125) {
       System.out.println( q );
    }else{
      System.out.println(-1);
    }
    
    
  } main {
    Scanner sc = new Scanner(System.in);
    // 整数の入力

    int a = sc.nextInt();
    int b = sc.nextInt();

    int p = a*100 / 8;
    if (( a*100 % 8) !=0) {
      p = p+1;
    }
      //int q = b*10;
    int q = b*10;
    //出力
    if ( b == p/10 ) {
      System.out.println( p );
    } else if ( a == q*10/125) {
       System.out.println( q );
    }else{
      System.out.println(-1);
    }
    
    
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int p = a*100 / 8; p a*100 / 8 a*100 a 100 8 if (( a*100 % 8) !=0) {
      p = p+1;
    } ( a*100 % 8) !=0 ( a*100 % 8) a*100 a 100 8 0 {
      p = p+1;
    } p = p+1 p p+1 p 1 int q = b*10; q b*10 b 10 if ( b == p/10 ) {
      System.out.println( p );
    } else if ( a == q*10/125) {
       System.out.println( q );
    }else{
      System.out.println(-1);
    } b == p/10 b p/10 p 10 {
      System.out.println( p );
    } System.out.println( p ) System.out.println System.out System System.out p if ( a == q*10/125) {
       System.out.println( q );
    }else{
      System.out.println(-1);
    } a == q*10/125 a q*10/125 q*10 q 10 125 {
       System.out.println( q );
    } System.out.println( q ) System.out.println System.out System System.out q {
      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 sc = new Scanner(System.in);
    // 整数の入力

    int a = sc.nextInt();
    int b = sc.nextInt();

    int p = a*100 / 8;
    if (( a*100 % 8) !=0) {
      p = p+1;
    }
      //int q = b*10;
    int q = b*10;
    //出力
    if ( b == p/10 ) {
      System.out.println( p );
    } else if ( a == q*10/125) {
       System.out.println( q );
    }else{
      System.out.println(-1);
    }
    
    
  }
} public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    // 整数の入力

    int a = sc.nextInt();
    int b = sc.nextInt();

    int p = a*100 / 8;
    if (( a*100 % 8) !=0) {
      p = p+1;
    }
      //int q = b*10;
    int q = b*10;
    //出力
    if ( b == p/10 ) {
      System.out.println( p );
    } else if ( a == q*10/125) {
       System.out.println( q );
    }else{
      System.out.println(-1);
    }
    
    
  }
} Main
import java.util.*;
public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    // 整数の入力

    int a = sc.nextInt();
    int b = sc.nextInt();

    int p = a*100 / 8;
    if (( a*100 % 8) !=0) {
      p = p+1;
    }
      //int q = b*10;
    int q = b*10;
    //出力
    if ( b == p/10 ) {
      System.out.println( p );
    } else if ( a == q*10/125) {
       System.out.println( q );
    }else{
      System.out.println(-1);
    }
    
    
  }
}


