A system has $4$ processes $A$, $B$, $C$, $D$ and $5$ allocatable resources $R_1, \: R_2,\: R_3, \: R_4,\: R_5$. The maximum resource requirement for each process and its current allocation are as follows:
$$\begin{array}{|c|c|}\hline \textbf{Process} & \textbf{Maximum} & \textbf{Allocation} \\ & R_1, R_2, R_3, R_4, R_5 & R_1, R_2, R_3, R_4, R_5 \\ \hline \text{A} & 1, 1, 2, 1, 3 & 1, 0, 2, 1, 1 \\ \text{B} & 2, 2, 2, 1, 0 & 2, 0, 1, 1, 0 \\ \text{C} & 2, 1, 3, 1, 0 & 1, 1, 0, 1, 0 \\ \text{D} & 1, 1, 2, 2, 1 & 1, 1, 1, 1, 0 \\ \\\hline \end{array}$$
Suppose the currently available count of resources is given by $0, \: 0,\: X,\: 1,\: 1$. What is the minimum value of $X$ for which this is a safe state? Justify your answer.