#include <bits/stdc++.h>
using namespace std;
int main() {
  double a, b;
  cin >> a >> b;
  double A = a / 0.08;
  double B = b / 0.1;
  double A_ = (a + 1) / 0.08;
  double B_ = (b + 1) / 0.1;
  double _A = (a - 1) / 0.08;
  double _B = (b - 1) / 0.1;
  if (A_ < B || B_ < A || A < _B || B < _A) {
    cout << -1 << endl;
    return 0;
  }
  int A_r = int(A);
  int B_r = int(B);
  if (A - double(int(A)) > 0) A_r += 1;
  if (B - double(int(A)) > 0) B_r += 1;
  int C = std::max(A_r, B_r);
  cout << C << endl;
  return 0;
}
