Diagonal Problem (Manual Counting)

How many squares does the diagonal of the rectangle pass through? Find a rule to determine the number of squares. Touch or click to shade and count the squares at the diagonal. Drag the red point to change the dimensions of the rectangle.
Anthony Or GeoGebra Institute of Hong Kong