The self-intersections of immersed manifolds