total and feature counting