Range in summation for polynomial As I was working with some multivariable polynomials, I considered the polynomial
$$
f(x_1,x_2,\cdots,x_n) \in \mathbb{Z}[x_1,x_2,\cdots,x_n]
$$
I chose to specify $f(x_1,x_2,\cdots,x_n)$ as follows
$$
f(x_1,x_2,\cdots,x_n)=\sum_{i=0}^? c_i\prod_{j=1}^n x_j^{r_{i,j}}
$$
But I can't figure out what to put for $?$. Clearly, if $f(x_1,x_2,\cdots,x_n)$ is of degree $d \geq 0$ there are at most $d^n$ possible terms. But many of these terms are not possible so that $c_i=0$. 
For example, if we had $f(x_1,x_2,x_3)$ with degree $2$, we could have $c_i x_1^2$ for some $c_i \in \mathbb{Z}$ as a term but not $c_i x_1 x_2^2$ because this contradicts the fact that $f(x_1,x_2,\cdots,x_n)$ has degree $2$. 
So the degree of $f(x_1,x_2,\cdots,x_n)$ eliminates many of the possible $d^n$ terms. Though I can certainly work around this by defining $f(x_1,x_2,\cdots,x_n)$ a different way, I was curious to find a formula for exactly how many such terms such a polynomial could have at maximum but always produced formulas which would over-count (such as the $d^n$ estimate) or under-count. Clearly, one could cheaply say something like the highest number of possible terms $N$ is
$$
N=\sum_{\substack{i=1 \\ e_{i,1}+e_{i,2}+\cdots+e_{i,n}\leq d}}^{d^n} 1^{e_{i,1}+e_{i,2}+\cdots+e_{i,n}}
$$ 
Is there a simple way to come up with this exactly?

The degree of a monomial in $n$ variables $(x_1,\ldots,x_n)$: $\prod_{i=1}^n x_i^{m_i}$ is $d=\sum_i m_i$. Let $a_n(d)$ denote he number of terms of degree $d$. Then one has the following generating function
$$
\sum_{d=0}^\infty a_n(d)\ q^n= \frac{1}{(1-q)^n}\ .
$$
The number of monomials of a given degree in one variable is generated by $(1-q)^{-1}$ as there is exactly one such monomial. For $n$-variables (with no relations) one just multiplies the generating functions for each variable. 
