#include<iostream>using namespace std;int main(){ int x; cin>>x; cout<<(x*6)-(x>10)*((x-10)*4)-(x>20)*((x-20)*1)-(x>40)*(x-40);}