#include <stdio.h>
#include <stdlib.h>
int main()
{
int n;
while (scanf("%d", &n)!=EOF)
{
if (n<=5)
printf ("0");
else if (n>=6&&n<=11)
printf("590");
else if (n>=12&&n<=17)
printf ("790");
else if(n>=18&&n<=59)
printf("390");
else printf("399");
}
return 0;
}