Counts stuff by applying the map-fn to the arguments. Assumes thatthe map-fn signature has the function to be applied as its last argument.