editing main method to count characters after MAX on a line