#include <iostream>
using namespace std;
int main()
{
int k, num, y = 0, w = 0, s = 0;
cin >> k;
while (k--)
{
cin >> num;
if (num == 1)
y++;
if (num == 5)
w++;
if (num == 10)
s++;
}
cout << y << endl
<< w << endl
<< s;
return 0;
}