#include #include #include #include #include #define rep(i,n) for(i=0; i> a #define out(a,b) cout << a << b using namespace std; using lint = long long; int main(void){ int i, j; int n, m; vector cnt(3,0); in(n); int input; rep(i,3){ rep(j,n){ cin >> input; cnt[i]+=input%3!=0; } } cout << cnt[0]*cnt[1]*cnt[2] << endl; return 0; }