#include <string>
#include <algorithm>
#include <iostream>
int main()
{
std::string s;
s = "aa bbbbbbbbbb cccccccc zzz ggggggg z";
const char symbol = 'z'; // подсчитываем этот символ
std::cout << std::count(s.begin(), s.end(), symbol) << std::endl;
return 0;
}