program sample
	implicit none
    real(8) :: a,b,x,y,x1,y1
    
    read(*,*) a,b
    
    x = a*100/8
    y = b*10
    x1 = (a+1)*100/8
    y1 = (b+1)*10
    
	if (x<=y .and. y<x1) then
    	write(*,*) int(y)
    else if (y<=x .and. x<y1) then
    	if (int(x) == x) then
    		write(*,*) int(x)
        else
        	write(*,*) int(x) + 1
        end if
    else
    	write(*,*) -1
    end if
    
    stop
end program sample