#include <iostream>
using namespace std;

void createFrq(int frq[], string word) {
    for (int i = 0; i < (int)word.size(); ++i) {
        if (word[i] >= 'A' && word[i] <= 'Z') {
            word[i] += 32;
        }
        ++frq[word[i]];
    }
}

bool isValid(int frq[]) {
    int cnt = 0;
    for (int i = 'a'; i <= 'z'; ++i) {
        if (frq[i] > 0) {
            ++cnt;
        }
    }
    return cnt <= 2;
}

int main() {
    string text;
    int cntValid = 0;
    while (getline(cin, text)) {
        string currWord = "";
        for (int i = 0; i <= (int)text.size(); ++i) {
            if (isalpha(text[i])) {
                currWord += text[i];
            } else if (!text.empty()) {
                int frqWord['z' + 1] = {0};
                createFrq(frqWord, currWord);
                if (isValid(frqWord)) {
                    ++cntValid;
                }
                currWord = "";
            }
        }
    }
    cout << cntValid;
    return 0;
}
