Two entries.
One for entering PVG. One for XMN, as you've already left China by flying to HKG.
I don't understand why one would fly PVG-HKG-XMN, that would cost much more and waste a lot of time, plus an extra visa. Instead of just flying SHA-XMN non-stop.