This is a method, you can also use the method of drawing. If the picture doesn't come out, it will be omitted
Finally, it is found that there is a line segment (0,4) to (4,0) when Z takes the maximum value, and a point (0, 1) when Z takes the minimum value, because an integer is to be taken, and the maximum values are: (0,4), (1 3), (2,2).
The minimum value is a point (0, 1), and those five points only determine a straight line, plus that minimum value (0, 1).
So in the end, it's six