#include <iostream>
#include <cstring>
using namespace std;
int main()
{
char sir[256];
int contor=0;
cout << "introdu sirul de caractere: \n";
cin.getline(sir,256);
int len=strlen(sir);
for (int i=0; i<len; ++i)
if (sir[i]=='a' || sir[i]=='b') ++contor;
cout << "nr de caractere 'a' sau 'b' este " << contor;
return 0;
}