Section 277. Whoever violates any provision of sections two hundred and seventy to two hundred and seventy-six, inclusive, shall be punished by a fine of not less than twenty-five dollars nor more than five hundred dollars or by imprisonment for not more than six months, or both. Any person convicted of a violation of any rule or regulation made under authority of section two hundred and seventy-four shall be punished by a fine of not more than one hundred dollars, as provided in the rule or regulation.