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