No building, structure or any part thereof, other than farm buildings, shall exceed 35 feet in height or three stories, whichever is greater, provided that such height limits may be exceeded by one foot for each foot by which the width of each side yard is increased beyond the minimum side yard requirements, up to a maximum height of 45 feet.