#include <bits/stdc++.h>
using namespace std;
int main()
{
int tmp,cnt118=0,cnt63=0,cnt41=0;
for(int i=0;i<8;i++)
{
cin>>tmp;
if(tmp>=118) cnt118++;
else if(tmp>=63) cnt63++;
else if(tmp>=41) cnt41++;
}
if(cnt118>=1) cout<<10;
else if(cnt63>=4) cout<<8;
else if(cnt41>=4) cout<<3;
else cout<<1;
return 0;
}