#include using namespace std; using ll = long long; int main(){ cin.tie(nullptr); ios_base::sync_with_stdio(false); ll ans=1, n; string s; for (int i=0; i<3; i++){ cin >> s; n = 1; if (s == "NONE") n = 0; else for (auto c : s) if (c == ',') n++; n = 16-n; ans *= n*n; } cout << ans << endl; return 0; }