Abstract. Given a factor code π from a shift of finite type X onto a sofic shift Y , an ergodic measure ν on Y , and a function V on X with summable variation, we prove an invariant upper bound on the number of ergodic measures on X which project to ν and maximize h(µ) + V dµ among all measures in the fiber π −1 (ν). If ν is fully supported, this bound is the class degree of π. This generalizes a previous result for the special case of V = 0.