#include using namespace std; int main() { string s[3]; cin >> s[0] >> s[1] >> s[2]; int num[3] = {0}; for( int i = 0; i < 3; i++ ) { if( s[i] == "NONE" ) num[i] = 16; else { int n = 1; int pos = 0; while( true ) { int j = s[i].find( ',', pos ); if( j == string::npos ) break; n++; pos = j + 1; } num[i] = 16 - n; } } int ans = num[0] * num[0] * num[1] * num[1] * num[2] * num[2]; cout << ans << endl; }