I tried to solve it mathematically, by determining the number of lines needed for 26, compared to the max possible in a 19x19 grid, but i suck at math :'(
I don't know if there is some analytical solution, but surely if there is, you can find it!
got 26