Counting statements and progress bar