To determine the amount spent on marketing that will achieve the maximum profit, we analyze the profit function given by:
\[ P = -5x^2 + 1000x + 5000 \]
This is a quadratic equation in the standard form \( P = ax^2 + bx + c \), where \( a = -5 \), \( b = 1000 \), and \( c = 5000 \). Since \( a < 0 \), the parabola opens downwards and has a maximum point at its vertex.
The x-coordinate of the vertex of a quadratic function can be calculated using the formula:
\[ x = -\frac{b}{2a} \]
Substituting the values of \( a \) and \( b \):
\[ x = -\frac{1000}{2 \times -5} = -\frac{1000}{-10} = 100 \]
Therefore, the amount spent on marketing to achieve the maximum profit is:
\[ \boxed{100} \text{ (in thousands of dollars)} \]