It's about 30 - unfortunately I can't cite a source on that (because I wouldn't know where to look for one, heh), but I'm quite sure.
There's the Quest for the Gold Masks sweepstakes that gave out two I think, plus the website design contest, and the Ignika design contest that tied in to BIONICLE Heroes in 2006. Those are the only ones given out in contests that I'm recalling, but a certain number were also given away as random, surprise door prizes at an event in New York, which would definitely bring the number above five. Others doubtless have been given out through other means, and the LEGO Group has probably held on to some.
EDIT: Cartoon Network also gave one out in 2002. That would bring the contest-distributed total to 5, as Mask collector said below.
Edited by Tazakk, Feb 21 2014 - 12:56 PM.