#include <iostream>
using namespace std;
int main() {
int answer;
while(cin>>answer){
if(0<=answer && answer<=100){
if(0<=answer && answer<11){
cout << answer*6;
}
else if(11<=answer && answer<21){
if(answer<20){
cout << (answer%10)*2 + 60;
}else{
cout << (answer/2)*2 + 60;
}
}
else if(21<=answer && answer<=40){
if(answer<30){
cout << (answer%10)*1 + 80;
}
else if(answer==30){
cout << (answer/3)*1 + 80;
}
else if(answer<40){
cout << (answer%10)*1 + 90;
}else{
cout << (answer/4)*1 + 90;
}
}else{
cout << 100;
}
}else{
cout<<"pleace re-enter your question number. ";
}
cout<<endl;
}
return 0;
}