#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; int main() { vector> xs(3, vector(16)); for (auto i = 0; i < 3; ++i) { string s; cin >> s; if (s == "NONE") continue; for (auto c : s) { if (c == ',') continue; if ('0' <= c && c <= '9') xs[i][c - '0'] = true; else xs[i][c - 'A' + 10] = true; } } int32_t ans = 1; for (auto i = 0; i < 3; ++i) { int32_t t = 0; for (auto x : xs[i]) { if (!x) ++t; } ans *= t * t; } cout << ans << endl; return 0; }