This is effectively a simple form of selection from a multiset. The general version would have varying limits for each $x_i$. You can use an inclusion-exclusion approach to enumerate the possibilities:
- Calculate the number of combinations as if there were no top limits
- Calculate the number of combinations that break the constraint for each single variable
- Calculate the number of combinations that break the constraint for pairs of variables
- Calculate the number that break the constraint for higher combinations
- Combine the above results according to the inclusion-exclusion rules
Obviously in this case we are only removing the $x_i= 4$ cases so a simpler argument can be used.