China + Corea

Good morning, I'm planning a trip to China this summer. The plan is to arrive in China on July 3rd and leave on August 2nd. During this period, I'd also like to go to South Korea for 5 days. My question is whether I would need a visa, or if I won't be in China for more than 30 days (since I'd be in Korea for 5 days). Do my no visa permission renew after coming black from Corea?

Thanks!