I could achieve my goal, i.e. it worked for me.
After tweeking a bit with countstart I think I found that it only works if the <pre... tag is on the same line as the first code line. Otherwise, the count starts at 1.
I did not use countincrement.