Let the number of dolls = D, cars = C, books = B
The mother said:
- There were dolls but six ⇒ gifts that are not dolls = 6 ⇒ C + B = 6
- There were cars but six ⇒ gifts that are not cars = 6 ⇒ D + B = 6
- All books but six ⇒ gifts that are not books = 6 ⇒ D + C = 6
Now add the three equations: \[ (C + B) + (D + B) + (D + C) = 6 + 6 + 6 = 18 \\ 2D + 2C + 2B = 18 \Rightarrow D + C + B = 9 \] So each of D, C, B = 9 Total gifts = 9 dolls + 9 cars + 9 books = 27