a,b,c,d,e,f,i;main(){d=e;e=f;scanf("%d",&f);e>f?f^=e^=f^=e:0;d>e?d^=e^=d^=e:0;++i-3||(a=d+e,b=d+f,c=e+f,d=e=f=0);i%6?main():printf("%d",a*f+b*e+c*d<<1);exit(0);}