#include using ll = long long; using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); string c[3]; cin >> c[0] >> c[1] >> c[2]; long res{ 1 }; for (int i = 0; i < 3; ++i) { long r = c[i] == "NONE" ? 16 : 16 - (c[i].size() + 1) / 2; res *= r*r; } cout << res << "\n"; return 0; }