So I know that I can solve a questions like "$x+y+z = 100$, how many triples can you make?" using stars and bars. However, how do I attempt to solve these when there are upper bounds on the values of $x$, $y$, or $z$. For instance, say this is the question:
$$x+y+z = 5 \\ x\leq4,\ y\leq5,\ z\leq3$$
How many ordered triples can I make?