there n segment draw plane ith segment connect point x_i 1 y_i 1 x_i 2 y_i 2 each segment nondegenerate horizontal vertical formally 1 n x_i 1 x_i 2 y_i 1 y_i 2 condition hold only segment different type intersect pair horizontal segment share common point pair vertical segment share common pointsWe segment have index h_1 h_2 v_1 v_2 h_1 h_2 v_1 v_2 form rectangle follow condition hold segment h_1 h_2 horizontal segment v_1 v_2 vertical segment h_1 intersects segment v_1 segment h_2 intersect segment v_1 segment h_1 intersects segment v_2 segment h_2 intersect segment v_2 please calculate number way choose segment form rectangle note condition h_1 h_2 v_1 v_2 hold