I would assume then that Jim is 17 years old and Mary is 15 years old however the problem says that their ages sum up to be greater than 32 - in essence Jim is any age above 17 and Mary can be any age above 15 so long as it is correspondent with Jim's 2 year lead.
I will use X as a variable to represent Jim's and Mary's age.
(X+2) + X > 32