Олимпиадный тренинг

Задача 23090. How many "i"


Задача

Темы: Строки Символы
Given a string divided into sentences. All sentences end with a dot. Determine the number of letters 'i' in the first sentence. 

Solve the problem without using the built-in string functions, except for a function that returns the length of a string.

Input: The program receives a string as input.

Output: need to print the number of letters 'i' in the first sentence.

Sample input and output
Test number Input Output
1 foresete. forest. 0
2 firist. forest 2

Запрещенные операторы:count;find