Let S be a set of integers such that:
$$S = \left \{\min(\mathbf{C}, a + b - 1) | a \in \left [ \mathbf{A} \right ], b \in \left [ \mathbf{B} \right ] \right \}$$
Note that $\mathbf{A}$, $\mathbf{B}$ and $\mathbf{C}$ are positive integers and we know $\mathbf{A} \leq \mathbf{B} \leq \mathbf{C}$
Also $\left [ x \right ]$ stands for $\left \{ 1, 2, 3, \cdots , x \right \}$
Can you figure out sum of all S elements using $\mathbf{A}$, $\mathbf{B}$ and $\mathbf{C}$ as parameters?