Basic statistics calculation.