#include using namespace std; int main(){ int N,A; int t,c; cin >> N; for(int i = 0; i < N; ++i){ cin >> A; if(A == 2){ c++; } if(A == 4){ t++; } } cout << t << " " << c << " " << endl; return 0; }