QOJ.ac

QOJ

Süre Sınırı: 2 s Bellek Sınırı: 64 MB Toplam puan: 100

#23768. JOI and IOI

İstatistikler

Problem

Write a program that finds how many places in a given string have $3$ consecutive characters arranged as JOI or IOI, respectively. The string consists only of uppercase English letters. For example, in JOIOIOI as shown in the figure below, JOI is included in $1$ place and IOI is included in $2$ places.

sample

Input

The input consists of $1$ line and includes $1$ string of uppercase English letters with a length of at most $10000$.

Output

The output consists of $2$ lines: output the number of JOI found on the $1$-st line, and the number of IOI found on the $2$-nd line.

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

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.