Page not loading? Try clicking here.
Placeholder

#2514

KOIOI 1s 32MB

Problems

Write a program that counts how many times the substrings "IOI" and "KOI" appear consecutively in a given string.

The string consists only of uppercase English letters.

For example, in the string "KOIOIOI", "KOI" appears 1 time and "IOI" appears 2 times.


Input

A single line containing a string of at most 10,000 uppercase English letters.


Output

Print two lines:

  • The first line should contain the number of times "KOI" appears.

  • The second line should contain the number of times "IOI" appears.


Example #1

KOIOIOI
1

2

Example #2

KORKDIOIDXHKOIOIOIOPKOI
2

3


Source

JOI 2007/2008 예선 2

You must sign in to write code.