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