John is y years old.If Mary is 2 years older than john and the sum of their ages is 24.How old is Mary ?