Calls the selector function for each value in the collection and returns the sum of the produced values.