Count number of commands