Masses and frequency of protoplanetary discs: a new approach.