<|im_start|>system
You are a helpful assistant. You first think about the reasoning process in the mind and then provide the user with the answer. You should try to truely solve the question by yourself without cheating.  <|im_end|>
<|im_start|>user
 Petya came up with 1004 monic quadratic trinomials \( f_{1}, \ldots, f_{1004} \), among the roots of which all integers from 0 to 2007 appear. Vasya considers all possible equations \( f_{i} = f_{j} \) ( \( i \neq j \) ), and for each root found, Petya pays Vasya one ruble. What is the smallest possible income for Vasya? Show your work in <think> </think> tags. And return the final answer in <answer> </answer> tags.<|im_end|>
<|im_start|>assistant
Let me solve this step by step.
<think>
user
0
Petya came up with 1004 monic quadratic trinomials \( f_{1}, \ldots, f_{1004} \), among the roots of which all integers from 0 to 2007 appear. Vasya considers all possible equations \( f_{i} = f_{j} \) ( \( i \neq j \) ), and for each root found, Petya pays Vasya one ruble. What is the smallest possible income for Vasya?
test