subtract 5 from d, then add 7 to the result