automatic and manual counting