length method working for lines to print in a month