#include<iostream>
#include<string>
using namespace std;
void main()
{
char c;
string str;
int len, count = 0;
cout << "Type the word you want: ";
getline(cin,str);
cout << "Type the letter you want to count: ";
cin >> c;
len = str.length();
for (int ctr = 0; ctr < len; ctr++)
{
if (str.at(ctr) == c)
{
count = count + 1;
}
}
cout << "\n";
cout << "There are " << count << " letters in " << str << endl;
}