#include <iostream> using namespace std; int main() { int n,res; cin>>n; res=n; while(n>=3) { int x=n/3; res+=x; n-=x*3; n+=x; } cout<<res<<endl; return 0; }