#include<iostream> using namespace std; int main(){ double x,y; cin>>x; if(x<=15){ cout<<x*6; }else{ cout<<(x-15)*9+15*6; } return 0; }