Let $\mathbb R_+:=[0,+\infty)$, and let the matrix functions $P$, $Q$, and $R$ of order $n$, $n\in\mathbb N$, defined on the semiaxis $\mathbb R_+$ be such that $P(x)$ is a nondegenerate matrix, $P(x)$ and $Q(x)$ are Hermitian matrices for $x\in\mathbb R_+$ and the elements of the matrix functions $P^{-1}$, $Q$, and $R$ are measurable on $\mathbb R_+$ and summable on each of its closed finite subintervals. We study the operators generated in the space $\mathscr L^2_n(\mathbb R_+)$ by formal expressions of the form
$$
l[f]=-(P(f'-Rf))'-R^*P(f'-Rf)+Qf
$$
and, as a particular case, operators generated by expressions of the form
$$
l[f]=-(P_0f')'+i((Q_0f)'+Q_0f')+P'_1f,
$$
where everywhere the derivatives are understood in the sense of distributions and $P_0$, $Q_0$, and $P_1$ are Hermitian matrix functions of order $n$ with Lebesgue measurable elements such that $P^{-1}_0$ exists and
$\|P_0\|,\|P^{-1}_0\|, \|P^{-1}_0\|\|P_1\|^2,\|P^{-1}_0\|\|Q_0\|^2 \in \mathscr L^1_{\mathrm{loc}}(\mathbb R_+)$.
The main goal in this paper is to study of the deficiency index of the minimal operator $L_0$ generated by expression $l[f]$ in $\mathscr L^2_n(\mathbb R_+)$ in terms of the matrix functions $P$, $Q$, and $R$ ($P_0$, $Q_0$, and $P_1$). The obtained results are applied to differential operators generated by expressions of the form
$$
l[f]=-f''+\sum_{k=1}^{+\infty}\mathscr H_k\delta(x-x_{k})f,
$$
where $x_k$, $k=1,2,\dots$, is an increasing sequence of positive numbers, with $\lim_{k\to +\infty}x_k=+\infty$, $\mathscr H_k$ is a number Hermitian matrix of order $n$, and $\delta(x)$ is the Dirac $\delta$-function.