#include #include #include #include using namespace std; template int maxReturn(T a, T b) {if (a > b) {return a;} else {return b;}} template int minReturn(T a, T b) {if (a < b) {return a;} else {return b;}} vector split (string str) { vector res; for (int i = 0; i < str.length(); i++) { if (str[i] != ',') { res.push_back(str[i]); } } return res; } int countLength (string str) { if (str == "NONE") return 16; return 16 - split(str).size(); } int main(void){ string R, G, B; cin >> R >> G >> B; int RCount = countLength(R); int GCount = countLength(G); int BCount = countLength(B); cout << (RCount * RCount) * (GCount * GCount) * (BCount * BCount) << endl; }