#include using ll = long long; template constexpr T MOD() { return 1000000007; } template constexpr T INF() { return std::numeric_limits::max() / 16; } int main() { int ans = 1; for (int i = 0; i < 3; i++) { std::string S; std::cin >> S; int p = (S == "NONE" ? 16 : 15); for (const char c : S) { if (c == ',') { p--; } } ans *= (p * p); } std::cout << ans << std::endl; return 0; }