3. There are 2019 stones piled into one heap. Player A first divides this heap into two, then multiplies the number of stones in the two heaps and writes the result on the blackboard; then, A chooses one of the two heaps and divides it into two again, similarly multiplying the number of stones in the two heaps and writing the result on the blackboard. A continues this process until there is exactly 1 stone in each heap. At this point, A adds up all the numbers on the blackboard. What is the sum?
3. The sum obtained is 2037171.

For a pile of stones consisting of $m$ stones, define $\frac{m(m-1)}{2}$ as the "capacity" of this pile. Therefore, for a pile of $a+b$ stones, its capacity is
$$
\begin{array}{l}
\frac{(a+b)(a+b-1)}{2} \\
=\frac{a(a-1)}{2}+\frac{b(b-1)}{2}+a b .
\end{array}
$$

When this pile is divided into two piles with $a$ and $b$ stones respectively, the sum of the capacities of the two piles and the number written on the blackboard is also $\frac{a(a-1)}{2}+\frac{b(b-1)}{2}+a b$.

This shows that the value before and after the operation must be equal. Therefore, it is proven that regardless of the number of operations, the sum of the numbers written on the blackboard and the capacities of each pile must be a constant.

According to the problem, we know that the capacities of all piles are 0 at the end of the operations.

Thus, the sum of the numbers written on the blackboard is equal to the capacity of the initial pile of stones, which is
$$
\frac{2019 \times 2018}{2}=2037171
$$