First reduce each number modulo 9, which can be done by adding up the digits of the numbers.