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 minB = 10*B;
    int maxB = minB+9;
    int minA = 0;
    int maxA = 0;
    if(A%2==0){
      minA = (25*A)/2;
      maxA = minA + 12;
    }else{
      minA = (25*A)/2+1;
      maxA = (25*(A+1)/2)-1;
    }
    if(minA>maxB||minB>maxA){
      System.out.println(-1);
    }else if(minA<=minB){
      System.out.println(minB);
    }else{
      System.out.println(minA);
    }
    
    
      
      
  }
  

  
} 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 minB = 10*B;
    int maxB = minB+9;
    int minA = 0;
    int maxA = 0;
    if(A%2==0){
      minA = (25*A)/2;
      maxA = minA + 12;
    }else{
      minA = (25*A)/2+1;
      maxA = (25*(A+1)/2)-1;
    }
    if(minA>maxB||minB>maxA){
      System.out.println(-1);
    }else if(minA<=minB){
      System.out.println(minB);
    }else{
      System.out.println(minA);
    }
    
    
      
      
  }
  

  
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();
    int minB = 10*B;
    int maxB = minB+9;
    int minA = 0;
    int maxA = 0;
    if(A%2==0){
      minA = (25*A)/2;
      maxA = minA + 12;
    }else{
      minA = (25*A)/2+1;
      maxA = (25*(A+1)/2)-1;
    }
    if(minA>maxB||minB>maxA){
      System.out.println(-1);
    }else if(minA<=minB){
      System.out.println(minB);
    }else{
      System.out.println(minA);
    }
    
    
      
      
  } main {
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();
    int minB = 10*B;
    int maxB = minB+9;
    int minA = 0;
    int maxA = 0;
    if(A%2==0){
      minA = (25*A)/2;
      maxA = minA + 12;
    }else{
      minA = (25*A)/2+1;
      maxA = (25*(A+1)/2)-1;
    }
    if(minA>maxB||minB>maxA){
      System.out.println(-1);
    }else if(minA<=minB){
      System.out.println(minB);
    }else{
      System.out.println(minA);
    }
    
    
      
      
  } 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 minB = 10*B; minB 10*B 10 B int maxB = minB+9; maxB minB+9 minB 9 int minA = 0; minA 0 int maxA = 0; maxA 0 if(A%2==0){
      minA = (25*A)/2;
      maxA = minA + 12;
    }else{
      minA = (25*A)/2+1;
      maxA = (25*(A+1)/2)-1;
    } A%2==0 A%2 A 2 0 {
      minA = (25*A)/2;
      maxA = minA + 12;
    } minA = (25*A)/2 minA (25*A)/2 (25*A) 25 A 2 maxA = minA + 12 maxA minA + 12 minA 12 {
      minA = (25*A)/2+1;
      maxA = (25*(A+1)/2)-1;
    } minA = (25*A)/2+1 minA (25*A)/2+1 (25*A)/2 (25*A) 25 A 2 1 maxA = (25*(A+1)/2)-1 maxA (25*(A+1)/2)-1 (25*(A+1)/2) 25*(A+1) 25 (A+1) A 1 2 1 if(minA>maxB||minB>maxA){
      System.out.println(-1);
    }else if(minA<=minB){
      System.out.println(minB);
    }else{
      System.out.println(minA);
    } minA>maxB||minB>maxA minA>maxB minA maxB minB>maxA minB maxA {
      System.out.println(-1);
    } System.out.println(-1) System.out.println System.out System System.out -1 1 if(minA<=minB){
      System.out.println(minB);
    }else{
      System.out.println(minA);
    } minA<=minB minA minB {
      System.out.println(minB);
    } System.out.println(minB) System.out.println System.out System System.out minB {
      System.out.println(minA);
    } System.out.println(minA) System.out.println System.out System System.out minA 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 minB = 10*B;
    int maxB = minB+9;
    int minA = 0;
    int maxA = 0;
    if(A%2==0){
      minA = (25*A)/2;
      maxA = minA + 12;
    }else{
      minA = (25*A)/2+1;
      maxA = (25*(A+1)/2)-1;
    }
    if(minA>maxB||minB>maxA){
      System.out.println(-1);
    }else if(minA<=minB){
      System.out.println(minB);
    }else{
      System.out.println(minA);
    }
    
    
      
      
  }
  

  
} public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();
    int minB = 10*B;
    int maxB = minB+9;
    int minA = 0;
    int maxA = 0;
    if(A%2==0){
      minA = (25*A)/2;
      maxA = minA + 12;
    }else{
      minA = (25*A)/2+1;
      maxA = (25*(A+1)/2)-1;
    }
    if(minA>maxB||minB>maxA){
      System.out.println(-1);
    }else if(minA<=minB){
      System.out.println(minB);
    }else{
      System.out.println(minA);
    }
    
    
      
      
  }
  

  
} 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 minB = 10*B;
    int maxB = minB+9;
    int minA = 0;
    int maxA = 0;
    if(A%2==0){
      minA = (25*A)/2;
      maxA = minA + 12;
    }else{
      minA = (25*A)/2+1;
      maxA = (25*(A+1)/2)-1;
    }
    if(minA>maxB||minB>maxA){
      System.out.println(-1);
    }else if(minA<=minB){
      System.out.println(minB);
    }else{
      System.out.println(minA);
    }
    
    
      
      
  }
  

  
}