Given a ring $A$, By the chain of prime ideals of $A$, we mean a sequence of prime ideals of $A$ such that $P_0 \subsetneq P_1 \dots \subsetneq P_{n-1}\subsetneq P_n$. Further this chain has a length $n$.
Define the dimension of a ring $A$ by $\operatorname{Dim}(A)$ to the supremum the lengths of all chains of prime ideals of $A$.
Show that if $\operatorname{Dim}(A)=0$ then every prime ideal is maximal.
Attempt: Suppose that there exists a prime ideal $X$ which is not maximal, then there exists an ideal $Y\subsetneq A$ properly containing $X$. Now my aim is to show that there exist a sequence of prime ideals $P_0 \subsetneq P_1 \dots \subsetneq P_{n-1}\subsetneq P_n$ with $n \geq 1$. I am getting $Y$ as an ideal. I am not getting any prime ideal after that. How should I proceed from here?
Also I cannot use $0=\{0\}$ since $0$ is not a prime ideal.