for an S-corp, only salary portion is charged with the self-employment tax, and the dividend portion is not charged with the self-employment tax.
but you must pay yourself a "reasonable" salary. if you pay out all the money as dividends, then IRS will audit you.