Finding the number of failures