#include using namespace std; int main() { string sr, sg, sb; cin >> sr >> sg >> sb; long long cr = sr == "NONE" ? 16 : 16 - (sr.size()+1)/2; long long cg = sg == "NONE" ? 16 : 16 - (sg.size()+1)/2; long long cb = sb == "NONE" ? 16 : 16 - (sb.size()+1)/2; return cr*cr*cg*cg*cb*cb; }