<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def terms(order, dim):
 """ Count the number of polynomials in an expansion. Parameters order : int The upper order for the expansion. dim : int The number of dimensions of the expansion. Returns ------- N : int The number of terms in an expansion of upper order `M` and number of dimensions `dim`. """

    return int(scipy.special.comb(order+dim, dim, 1))