I'm a little bit tired, so hope I am doing the math right. You have a 16 tooth difference in front, and an 18 tooth difference in the rear. You thus need a derailleur capable of soaking up 16 + 18 = 34 teeth.
Shimano should say on their site how many teeth each cage length is good for. I'm guessing you'll need medium, but check the numbers on the Shimano site to be sure.