Not three in a line!

not 3

Above are some 3×3 grids with some of the ways 3 counters can be arranged in a row.

I’d like to know what is the most amount of counters you could place in a 3×3 grid WITHOUT getting 3 in a row!

 

not 4

And then… how many counters can you put in a 4×4 grid without getting 3 in a row!