A dimension formula for Ekedahl-Oort strata