On the Chern number of an ideal