#include using namespace std; using ll=long long; #define rep(i,p,n)for(ll i=(ll)p;i<(ll)n;i++) #define all(x)(x).begin(),(x).end() #define edt(x1,y1,x2,y2)sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)) int main(){ ll X; cin>>X; vector vec={"A","A","B","B","A","B","B"}; ll ans=0,pos=0,cnt=0; while(pos!=X){ if(vec[cnt%7]=="A"){ pos+=2; ans+=2; } else{ pos-=1; ans+=1; } cnt++; } cout<