I'm having trouble imagining a situation where this would help you with ham though. Probably either all ham counts as ultra processed, or none of it does. (My money is on the former)
If it was based on the number of ingredients, maybe there would be some case where one ham has an additional flavoring or something that puts it over the limit. But how likely is it that the extra ingredients would have a significant effect? Probably not much compared to the ham itself, plus the salt or whatever that's in it.