#include #include #include #include #include using namespace std; typedef long long int llint; #define pub push_back //A //BABA int main(void){ llint n,ansa,ansb,ansc,ok=0; cin>>n; ansa=(n/10000)*(n/10000)*3; ansb=(n/10000)*(n%10000)*6; ansc=(n%10000)*(n%10000)*3; ansb+=ansc/100000000; ansc%=100000000; ansa+=ansb/100000000; ansb%=100000000; if(ansa>0){ printf("%lld",ansa);ok=1; } if(ok==1){ printf("%04lld",ansb);ok=1; } else if(ansb>0){ printf("%lld",ansb);ok=1; } if(ok==1){printf("%04lld",ansc);ok=1;} else{ printf("%lld",ansc);} return 0; }