시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 1805 1356 1225 76.182%

문제

입력으로 주어지는 문자열에서 연속으로 3개의 문자가 JOI 또는 IOI인 곳이 각각 몇 개 있는지 구하는 프로그램을 작성하시오. 문자열을 알파벳 대문자로만 이루어져 있다. 예를 들어, 아래와 같이 "JOIOIOI"에는 JOI가 1개, IOI가 2개 있다.

입력

첫째 줄에 알파벳 10000자 이내의 문자열이 주어진다. 

출력

첫째 줄에 문자열에 포함되어 있는 JOI의 개수, 둘째 줄에 IOI의 개수를 출력한다.

예제 입력 1

JOIOIOIOI

예제 출력 1

1
3
W3sicHJvYmxlbV9pZCI6IjU1ODYiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJKT0lcdWM2NDAgSU9JIiwiZGVzY3JpcHRpb24iOiI8cD5cclxuXHRcdWM3ODVcdWI4MjVcdWM3M2NcdWI4NWMgXHVjOGZjXHVjNWI0XHVjOWMwXHViMjk0IFx1YmIzOFx1Yzc5MFx1YzVmNFx1YzVkMFx1YzExYyBcdWM1ZjBcdWMxOGRcdWM3M2NcdWI4NWMgM1x1YWMxY1x1Yzc1OCBcdWJiMzhcdWM3OTBcdWFjMDAgSk9JIFx1YjYxMFx1YjI5NCBJT0lcdWM3NzggXHVhY2YzXHVjNzc0IFx1YWMwMVx1YWMwMSBcdWJhODcgXHVhYzFjIFx1Yzc4OFx1YjI5NFx1YzljMCBcdWFkNmNcdWQ1NThcdWIyOTQgXHVkNTA0XHViODVjXHVhZGY4XHViN2E4XHVjNzQ0IFx1Yzc5MVx1YzEzMVx1ZDU1OFx1YzJkY1x1YzYyNC4gXHViYjM4XHVjNzkwXHVjNWY0XHVjNzQ0IFx1YzU0Y1x1ZDMwY1x1YmNiMyBcdWIzMDBcdWJiMzhcdWM3OTBcdWI4NWNcdWI5Y2MgXHVjNzc0XHViOGU4XHVjNWI0XHVjODM4IFx1Yzc4OFx1YjJlNC4gXHVjNjA4XHViOTdjIFx1YjRl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