#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define FOR(i,m,n) for(int i=(m);i<(n);++i) #define REP(i,n) FOR(i,0,n) #define ALL(v) (v).begin(),(v).end() const int INF = 0x3f3f3f3f; const long long LINF = 0x3f3f3f3f3f3f3f3fLL; /*----------------------------------------*/ int main() { cin.tie(0); ios::sync_with_stdio(false); // freopen("input.txt", "r", stdin); string r, g, b; cin >> r >> g >> b; long long ans = 1; long long rr = 16, gg = 16, bb = 16; if (r != "NONE") rr -= (r.length() + 1) / 2; if (g != "NONE") gg -= (g.length() + 1) / 2; if (b != "NONE") bb -= (b.length() + 1) / 2; ans *= rr * rr * gg * gg * bb * bb; cout << ans << '\n'; return 0; }