Divisible by 3 optimization.