#include <stdio.h>
#include <math.h>

typedef struct{
	double x;
	double y;
}Point;

Point scan_point(void){
	Point p;
	scanf("%lf,%lf",&p.x,&p.y);
	return p;
}

double area_of(Point p1,Point p2){
	double width,height;
	
	width = fabs(p2.x - p1.x);
	height = fabs(p2.y - p1.y);
	
	return width * height;
}

double circumference_of(Point p1,Point p2){
	double width,height;
	
	width = fabs(p2.x - p1.x);
	height = fabs(p2.y - p1.y);
	
	return 2.0 * (width + height);
}

int main(void) {
	Point p1,p2;
	p1 = scan_point();
	p2 = scan_point();
	
	printf("左上隅と右下隅の座標を入力してください\n");
	
	printf("座標1：(%2f,%2f)\n",p1.x,p1.y);
	printf("座標2：(%2f,%2f)\n",p2.x,p2.y);
	
	printf("面積：%2f\n",area_of(p1,p2));
	printf("周囲の長さ：%2f\n",circumference_of(p1,p2));
	
	return 0;
}
