/*
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 takes case into account (i.e. it's case sensitive).
*/

#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 (s[i] == c)
                        count++;
	cout << c << " appears in the input: "
		<< count << " times.\n";
        return 0;
}


