/*
#include<stdio.h>
int main()
{
int n,i,max=0,sum=0,boom=0;
int h[6]={};
for(i=1;i<=5;i++)
{
scanf("%d",&h[i]);
if(max<h[i])
{
max=h[i];
}
}
for(i=1;i<=5;i++)
{
if(sum<h[i]&&max!=h[i])
{
sum=h[i];
}
}
for(i=1;i<=5;i++)
{
if(boom<h[i]&&max!=h[i]&&sum!=h[i])
{
boom=h[i];
}
}
printf("%d",boom);
return 0;
}
*/
#include<stdio.h>
int main()
{
int a;
scanf("%f",&a);
if(a<=500)
{
printf("%d",(int)(a*0.7));
}
else if(a>500&&a<=1500)
{
printf("%d",(int)(a-500)*0.4+350);
}
else if(a>1500&&a<=4500)
{
printf("%d",(int)(a-1500)*0.15+750);
}
else if(a>4500&&a<=10000)
{
printf("%d",(int)(a-4500)*0.05+1200);
}
else
{
printf("%d",(int)(a-10000)/100*2+1475);
}
return 0;
}