Being a beautiful ancient city, Xi'an is the capital city of Zhou, Qin, Han, and Tang Dynasties. With a long history, the streets in Xi'an have a grid pattern.
Attracted by the streets' structure, Coach would like to conduct his research on them. He draws an grid on the board. The grid consists vertical line segments and horizontal line segments. The vertical and horizontal line segments intersect at exactly points, forming unit squares. We call the intersections s. Output the number of line segments(not only vertical or horizontal) satisfying the following three conditions: