Section 5. Whoever keeps or maintains such a nuisance shall be punished by a fine of not less than one hundred nor more than one thousand dollars and by imprisonment for not less than three months nor more than three years.