#include #include int main() { char r[102], g[102], b[102]; scanf("%s%s%s", r, g, b); int ans = 1; int c; int i, n; if (r[0] == 'N') ans *= 16 * 16; else { c = 1; n = strlen(r); for (i = 0; i < n; i++) if (r[i] == ',') c++; ans *= (16 - c) * (16 - c); } if (g[0] == 'N') ans *= 16 * 16; else { c = 1; n = strlen(g); for (i = 0; i < n; i++) if (g[i] == ',') c++; ans *= (16 - c) * (16 - c); } if (b[0] == 'N') ans *= 16 * 16; else { c = 1; n = strlen(b); for (i = 0; i < n; i++) if (b[i] == ',') c++; ans *= (16 - c) * (16 - c); } printf("%d\n", ans); return 0; }