How to get the amount of selected files in automator
You can use the following Apple Script to set a variable (named item_count) to the number of items returned from the previous action:

on run {input, parameters}
    set (value of variable "item_count" of front workflow) to (count of input)
    return input
end run


The list of items is simply passed through.

You could use it like this: