Input: I gave a book to John's mother and a magazine to him.
Output: 0