P26697 [AtCoder] JOI and IOI
普及+
题目描述

Problem Description

Create a program that counts how many places in a given string have a sequence of 3 consecutive characters that are either "JOI" or "IOI". The string consists only of uppercase alphabetic characters. For example, in the string "JOIOIOI", there is 1 occurrence of "JOI" and 2 occurrences of "IOI".

2008-yo-t2-sample.png


Input Format

The input consists of one line, containing at most 10,000 uppercase alphabetic characters.

Output Format

The output consists of 2 lines. The first line should contain the number of occurrences of "JOI", and the second line should contain the number of occurrences of "IOI".


Sample Input and Output

Sample Input #1

JOIJOI

Sample Output #1

2
0

Sample Input #2

JOIOIOIOI

Sample Output #2

1
3

Sample Input #3

JOIOIJOINXNXJIOIOIOJ

Sample Output #3

2
3

Notes/Hints

Sample Explanation 1

- - - - - -

Sample Explanation 2

- - - - - -

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
JOIJOI
样例输出
2 0