function counts = candy_count_box_sum ( c, l, m, n )

  counts = zeros ( c, 1 );

  for i = 1 : l
    for j = 1 : m
      for k = 1 : n
        cijk = mod ( i + j + k - 3, c ) + 1;
        counts(cijk) = counts(cijk) + 1;
      end
    end
  end

  return
end

