How many rectangles can be found in this shape?

Label the lines starting from $1$ on the left to $n+1$ on right/above. Extend the lines by $1$ unit to create tetherings. There are $n+3$ of them, label these from $1$ to $n+3$. The diagram is for $n=5$.

enter image description here

There is a bijection between the coordinates of four vertices of any rectangle and the coordinates at end of tetherings which determine the four edges of the given rectangle.

For example, the rectangle with vertices at $(1,1),(5,1),(5,3),(1,3)$ corresponds to the unique quadruplet $(1,3,4,8)$.


Searching ${n+3 \choose 2}$ at OEIS you can find in A000332 the reference to A004320 and there the document Counting the lattice rectangles inside Aztec diamonds and square biscuits by Teofil Bogdan and Mircea Dan Rus and the solution to problem 3, on page 3. Basically, for each rectangle you have to choose four coordinates for the vertices $(x_1,y_1), (x_1,y_2), (x_2,y_1), (x_2,y_2)$ with $x_1 \lt x_2 \lt y_1 \lt y_2$ among $n+3$ values.