How do you calculate the Herfindahl- Hirschmann Index ?

http://www.unclaw.com/chin/teaching/antitrust/herfindahl.htm

http://en.wikipedia.org/wiki/Herfindahl_index