calc total lines