/*
Write a program to read a character C and then a string S and to 
display how many times C appears in S.
This program does not take case into account (i.e. it's case 
insensitive). 
*/

#include <iostream>
#include <string>
using namespace std;
int main()
{
	string s;
	char c;
	int i, count = 0;
	cout << "Enter a string: " << endl;
	cin >> s;
	cout << "Enter a character: " << endl;
	cin >> c;
	for (i = 0; i < s.size(); i++)
		if (tolower(s[i]) == tolower(c))
			count++;
	cout << count << endl;
	return 0;
}
