#include <iostream>

using namespace std;

int main()
{
  int a;
  int b;
  cin >> a >> b;
  if((100*a + 99)/8 < 10*b || 10*b + 9 < (100*a + 7)/8){
      cout << -1;
  } else{
      cout << max((100*a + 7)/8, 10*b);
  }
}