Differential and Difference Dimension Polynomials