#include #define int long long #define double long double using namespace std; const int MOD = 1000000007; const int INF = 1e11; using Graph = vector>; signed main(){ string A, B, C; cin >> A >> B >> C; int a = 0; int b = 0; int c = 0; if( A == "NONE" ) a = 16; else{ a = (int) A.size(); a = (a+1)/2; a = 16-a; } if( B == "NONE" ) b = 16; else{ b = (int)B.size(); b = (b+1)/2; b = 16-b; } if( C == "NONE" ) c = 16; else{ c = (int)C.size(); c = (c+1)/2; c = 16-c; } cout << a*a*b*b*c*c << endl; }