Your task is to write a program, that for each word search given,
prints how many times appears the word "OIE"
inside of it, horizontally, verticaly, or in diagonal. (In total, you
must check 8 different senses.)
The input consists of a series of cases. Each case consists of two numbers and , both of them between 1 and 100, followed by rows with uppercase letters each one.
For each word search, your program must print how many times appears
"OIE" inside of it.
Input
3 3 OIE IIX EXE 1 10 EIOIEIOEIO 5 5 EAEAE AIIIA EIOIE AIIIA EAEAE 7 2 OX IO EX II OX IE EX 1 1 E
Output
3 4 8 3 0