1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#include <iostream> #include <string> #include <algorithm> using namespace std; int main() { string str; getline(cin, str); cout << std::count(str.begin(), str.end(), 'i'); return 0; }