Carol wants to go to California!
Tudor recently gave Carol a game with similarities to Boggle. There is an grid of letters,
all of which are either
I. In a single turn, Carol must select a
I such that the
A touch in at least one corner, as do the
L as well as the
I. Carol gains one point for doing so, but cannot select any of those letters in future turns.
Compute the maximum number of points Carol can earn.
In tests worth marks, you may assume .
In tests worth an additional marks, you may assume .
The first line of the input contains a single integer, .
The next lines contain characters, all of which appear in
Output, on a single line, the maximum number of points Carol can earn if she plays optimally.
4 CALI ILAC CLLC IAAI