Count rules starting from zero