Connecting Gaps with Tetris Pieces
CJam, 53

'[,73&gt;qf{1$e=s':+\+~}:+3*I+O-SZ-JO+m0e&gt;ZS-LO+-e&gt;2+3/-


Try it online

The idea is: assign each of the I, J, ..., Z variables to be the number of occurences of that letter, and calculate string length * 3 + I - O. Then count the number of non-compensated S's or Z's: an S can be compensated by Z, J or O, and a Z can be compensated by S, L or O, and subtract ceil(that number/3), as we lose 1 unit for every 3 S's or Z's.