Input: If he is a rich man, he'd buy a diamond ring.
Output: 0