5. In a regular $1000-$gon, all diagonals are drawn. What is the maximum number of diagonals that can be selected such that among any three of the selected diagonals, at least two have the same length?
Answer: 2000

Solution: For the condition of the problem to be met, it is necessary that the lengths of the diagonals take no more than two different values. The diagonals connecting diametrically opposite vertices are 500. Any other diagonal can be rotated to coincide with a diagonal of the corresponding length, i.e., there are 1000 of them. Therefore, 2000 can be chosen while meeting the condition.