Consider the algebraic function Φg,n that assigns to a general g-dimensional abelian variety an n-torsion point. A question first posed by Kronecker and Klein asks: What is the minimal d such that, after a rational change of variables, the function Φg,n can be written as an algebraic function of d variables? Using techniques from the deformation theory of p-divisible groups and finite flat group schemes, we answer this question by computing the essential dimension and p-dimension of congruence covers of the moduli space of principally polarized abelian varieties. We apply this result to compute the essential p-dimension of congruence covers of the moduli space of genus g curves, as well as its hyperelliptic locus, and of certain locally symmetric varieties.