Note that this is simply the Mary's Apples problem using different words and number. Learn to solve one problem and know how to solve all problems.