#include<bits/stdc++.h> using namespace std; int main(){ int a; cin>>a; if(a>=1&&a<10) cout<<2*a-1<<endl; else cout<<3*a-11<<endl; return 0; }