This image shows the process for computing sums and counts.