#include <iostream>
#include <vector>
#include<string>
#include<algorithm>

using namespace std;

struct Compare {
std::string str;
Compare(const std::string& x) : str(x) { 
    std::sort(str.begin(),str.end()); std::transform(str.begin(), 
    str.end(),str.begin(), ::toupper);}

    bool operator ()(const std::string& t)
    {
        std::string s= t;
        std::transform(s.begin(), s.end(),s.begin(), ::toupper);
        std::sort(s.begin(),s.end());

    return s == str;
    }
};




int main(int argc, char *argv[]) {  

std::vector<std::string> words {"Vile","Veil",  "Live"};

int count = std::count_if(words.begin(), words.end(), Compare("Evil"));

cout << count << endl;
}