#include<iostream> using namespace std; int main(){ int a=0,n; cin>>n; while(n){ a=a*10+n%10; n/=10; } cout<<a*2+1<<endl; return 0; }