#include <iostream>
#include <cmath>
using namespace std;
double s1(double a1, double a2, double a3, double b1, double b2, double b3){
return sqrt((a2*b3-a3*b2)*(a2*b3-a3*b2)+(a3*b1-a1*b3)*(a3*b1-a1*b3)+(a1*b2-a2*b1)*(a1*b2-a2*b1));
}
int main() {
double ax, ay, az, bx, by, bz, cx, cy, cz, sab, sac, sbc, s;
cin >> ax >> ay >> az >> bx >> by >> bz >> cx >> cy >> cz;
sab = s1(ax, ay, az, bx, by, bz);
sac = s1(ax, ay, az, cx, cy, cz);
sbc = s1(bx, by, bz, cx, cy, cz);
s=((ax==bx && ay==by && az==bz) || (ax==cx && ay==cy && az==cz) || (bx==cx && by==cy && bz==cz))?(sab+sac+sbc):(sab+sac+sbc)*2;
cout << s;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y21hdGg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiBkb3VibGUgczEoZG91YmxlIGExLCBkb3VibGUgYTIsIGRvdWJsZSBhMywgZG91YmxlIGIxLCBkb3VibGUgYjIsIGRvdWJsZSBiMyl7CiAJcmV0dXJuIHNxcnQoKGEyKmIzLWEzKmIyKSooYTIqYjMtYTMqYjIpKyhhMypiMS1hMSpiMykqKGEzKmIxLWExKmIzKSsoYTEqYjItYTIqYjEpKihhMSpiMi1hMipiMSkpOwogfQppbnQgbWFpbigpIHsKCWRvdWJsZSBheCwgYXksIGF6LCBieCwgYnksIGJ6LCBjeCwgY3ksIGN6LCBzYWIsIHNhYywgc2JjLCBzOwoJY2luID4+IGF4ID4+IGF5ID4+IGF6ID4+IGJ4ID4+IGJ5ID4+IGJ6ID4+IGN4ID4+IGN5ID4+IGN6OwoJc2FiID0gczEoYXgsIGF5LCBheiwgYngsIGJ5LCBieik7CglzYWMgPSBzMShheCwgYXksIGF6LCBjeCwgY3ksIGN6KTsKCXNiYyA9IHMxKGJ4LCBieSwgYnosIGN4LCBjeSwgY3opOwoJcz0oKGF4PT1ieCAmJiBheT09YnkgJiYgYXo9PWJ6KSB8fCAoYXg9PWN4ICYmIGF5PT1jeSAmJiBhej09Y3opIHx8IChieD09Y3ggJiYgYnk9PWN5ICYmIGJ6PT1jeikpPyhzYWIrc2FjK3NiYyk6KHNhYitzYWMrc2JjKSoyOwoJY291dCA8PCBzOwoJcmV0dXJuIDA7Cn0=