count elems in array