count number of statements for error detection