If the ordinary differential equation
\[
x^2 \frac{d^2 \phi}{dx^2} + x \frac{d\phi}{dx} + x^2 \phi = 0, \quad x>0
\]
has a solution of the form \( \phi(x) = x^r \sum_{n=0}^{\infty} a_n x^n \), where \( a_n \)'s are constants and \( a_0 \neq 0 \), then the value of \( r^2 + 1 \) is __________.