Problem: problem

Create a program that counts the number of consecutive JOI or IOI characters in a given character string. The character string consists only of uppercase letters of the alphabet. For example, the character string "JOIOIOI" in the figure below contains JOI in one place and IOI in two places.

<image>



input

The input consists of multiple datasets. Each dataset is one line and consists of uppercase letters of the alphabet of 10,000 characters or less. Input ends with EOF.

The number of datasets does not exceed 5.

output

For each dataset, output the number of JOIs found in the first line and the number of IOIs found in the second line.

Examples

Input

JOIJOI
JOIOIOIOI
JOIOIJOINXNXJIOIOIOJ


Output

2
0
1
3
2
3


Input

None


Output

None

Solution (in JAVA):

Solution:
import java.util.Scanner;


public class Main {
	static String[] a = new String[] {"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"};
	static String[] b = new String[] {"D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","A","B","C"};
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		while (stdIn.hasNext()) {
			String tmp = stdIn.next();
			tmp = tmp.toLowerCase();
			int j = sorvj(tmp);
			int i = sorvi(tmp);
			System.out.println(j);
			System.out.println(i);
		}
	}
	
	static int sorvj(String a) {
		int ans = 0;
		for(int i = 0; i < a.length() - 2; i++) {
			IN:for(int j = 0; j < 3; j++) {
				switch(j) {
				case 0: if(a.charAt(i) != 'j') break IN; break;
				case 1: if(a.charAt(i + 1) != 'o') break IN; break;
				case 2: if(a.charAt(i + 2) == 'i') ans++; break;
				}
			}
		}
		return ans;
	}
	
	static int sorvi(String a) {
		int ans = 0;
		for(int i = 0; i < a.length() - 2; i++) {
			IN:for(int j = 0; j < 3; j++) {
				switch(j) {
				case 0: if(a.charAt(i) != 'i') break IN; break;
				case 1: if(a.charAt(i + 1) != 'o') break IN; break;
				case 2: if(a.charAt(i + 2) == 'i') ans++; break;
				}
			}
		}
		return ans;
		
	}
	
}