How to evaluate f (v) = max {2 + h (w): p (w) = p (v), w ≠ v}?

How is this function evaluated f (v) = max {2 + h (w): p (w) = p (v), w ≠ v}?