Counting polynomial