#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,c,d,e,f,g,h,i,j,hand,ans;
while(cin>>a>>b>>c>>d>>e>>f>>g>>h>>i>>j>>hand){
if(hand+30>=a) ans++;
if(hand+30>=b) ans++;
if(hand+30>=c) ans++;
if(hand+30>=d) ans++;
if(hand+30>=e) ans++;
if(hand+30>=f) ans++;
if(hand+30>=g) ans++;
if(hand+30>=h) ans++;
if(hand+30>=i) ans++;
if(hand+30>=j) ans++;
cout<<ans<<endl;
}
return 0;
}