line counter that ignores empty lines, lines with only }, and comment lines