program prob1
    implicit none
    integer::A, B, i, atax, btax, ataxmax, btaxmax
    read(*,*) A, B

    btax = B*10
    btaxmax = B*10+9
    if(mod(A,2) == 1)then
        atax = A*100/8 + 1
        ataxmax = atax + 11
    else
        atax = A*100/8
        ataxmax = atax + 12
    end if

    if(btax <= atax) then
        if(btaxmax >= atax)then
            write(*,*) atax
        else
            write(*,*) -1
        end if
    else
        if(ataxmax >= btax) then
            write(*,*) btax
        else
            write(*,*) -1
        end if
    end if

    stop
end program prob1