Also calculate the total size of instances per class.