The Mass Function of Cosmic Structures with Nonspherical Collapse