#include <fstream>
#include <iomanip>
using namespace std;
int main()
{
    ifstream a("TAXI.inp");
    ofstream b("TAXI.out");
    int i;
    float n = 0;
    a >> i;
    a.close();
    for (int m = 1; m <= i; m++)
    {
        if (m < 6)
        {
            if (m < 2)
            {
                n = n + 5000;
            }
            else n = n + 4500;
        }
        else n = n + 3500;
    }
    if (i <= 120) b << fixed << setprecision(2) << n;
    else b << fixed << setprecision(2) << n*9/10;
    b.close();
    return 0;
}
