#include <iostream> #include <cstdio> using namespace std; int main() { int x; cin>>x; if (1<=x&&x<10) { cout<<2*x-1; }else if(x>=10) { cout<<3*x-11; } return 0; }