There are $2017$ points on the plane, no three of them are collinear. Some pairs of the points are connected by $n$ segments. Find the smallest value of $n$ so that there always exists two disjoint segments in any case.

Let's think step by step and output the final answer within \boxed{}.
user