import std.stdio, std.conv, std.string, std.algorithm, std.math, std.array, std.container;

int a, b;

int solve() {
  int amin=-1, amax, bmin=-1, bmax;
  for(int i=1; i<=1500; i++) {
    int a_ = floor(i*0.08).to!int;
    int b_ = floor(i*0.1).to!int;
    if(a_ == a) {
      if(amin == -1) amin = i;
      amax = i;
    }
    if(b_ == b) {
      if(bmin == -1) bmin = i;
      bmax = i;
    }
  }
  if(amin == -1 || bmin == -1) return -1;
  if(amax < bmin || amin > bmax) return -1;
  return max(amin, bmin);
}

void main() {
  readf("%d %d", &a, &b);
  writeln(solve());
}

