#include <fstream>
#include <iostream>

using namespace std;

int main()
{
	ifstream fin("input.txt");
	ofstream fout("output.txt");

	int x1,y1,x2,y2,x3,y3;
	fin>>x1>>y1>>x2>>y2>>x3>>y3;

	if (abs(x1-x2)==abs(y2-y3) && abs(y1-y2)==abs(x2-x3) ||
		abs(x1-x2)==abs(y1-y3) && abs(y1-y2)==abs(x1-x3))
		fout<<(abs(x1-x2)+abs(y1-y2))*(abs(x1-x2)+abs(y1-y2))-2*abs(x1-x2)*abs(y1-y2);
	else
	if (abs(x1-x3)==abs(y2-y3) && abs(y1-y3)==abs(x2-x3))
		fout<<(abs(x1-x3)+abs(y1-y3))*(abs(x1-x3)+abs(y1-y3))-2*abs(x1-x3)*abs(y1-y3);
	else fout<<-1;
	fin.close();
	fout.close();

	return 0;
}

