Count only pending tasks