#include <iostream>
#include <cmath>
using namespace std;
int main()
{ int a;
while(cin>>a)
{
if(a<=5)
{
cout<<0<<endl;
}
else
{
if(a<=11)
{
cout<<590<<endl ;
}
else if(a<=17)
{
cout<< 790<<endl;
}
else if(a<=59)
{
cout<< 890<<endl;
}
else
{
cout<< 399<<endl;
}
}
}
return 0;
}