#include<iostream>
using namespace std;
int main()
{
int n,sum=0;
cin>>n;
if(n<50 && n>=30)
{
sum = (n-30)/10+4;
}
else if(n<30) sum = n/10;
else if(n>=50)
{
int a = n/50;
int b = n%50/30;
sum= a*7+b*4+(n-a*50-b*30)/10;
}
cout<<sum;
return 0;
}