#include #define rep(i,a,n) for (int i = a;i < n;i++) using namespace std; int main() { int n,a,k=0,t=0; cin >> n; rep(i,0,n){ cin >> a; if(a == 2){ k++; }else{ t++; } } printf("%d %d\n",t,k); }