#include using namespace std; int f(string s) { int n = s.size(); n = (n == 4) ? 16 : (16 - ++n / 2); return n * n; } int main() { string A, B, C; cin >> A >> B >> C; cout << f(A) * f(B) * f(C) << "\n"; }