Let $\mathcal{S}^d_{\epsilon}$ be the collection of all sets $S:=\{\mathbf{x}_1, \mathbf{x}_2, \ldots \mathbf{x}_{d+1}\}$ of $d+1$ points in a $d$-dimensional Euclidean space such that, for a given constant $\epsilon>0$, we have $\|\mathbf{x}_i-\mathbf{x}_j\|_2\in[1-\epsilon,1]$ for all $i\neq j$.
Given any set $S\in\mathcal{S}^d_{\epsilon}$, let $n(S)$ be the number of triangles whose vertices $\mathbf{x}_i, \mathbf{x}_j, \mathbf{x}_k$ are points of $S$, such that $\|\mathbf{x}_i-\mathbf{x}_j\|_2=\|\mathbf{x}_j-\mathbf{x}_k\|_2=1$ and $\|\mathbf{x}_k-\mathbf{x}_i\|_2<1$.
Question: How can we calculate (or approximate) $m(d,\epsilon):=\max_{S\in\mathcal{S}^d_{\epsilon}}n(S)$?