#!/usr/bin/perl -w

use v5.30;
use strict;

my @pts = map { [ /(\d+)/g ] } <>;

my ($minx, $miny, $maxx, $maxy);
for my $pt (@pts) {
	$minx = $pt->[0] if !defined $minx || $minx > $pt->[0];
	$maxx = $pt->[0] if !defined $maxx || $maxx < $pt->[0];
	$miny = $pt->[1] if !defined $miny || $miny > $pt->[1];
	$maxy = $pt->[1] if !defined $maxy || $maxy < $pt->[1];
}

my (%count, %inf);
for my $x ($minx .. $maxx) {
for my $y ($miny .. $maxy) {
	my ($minpt, $mindist);
	for my $i (0 .. $#pts) {
		my $pt = $pts[$i];
		my $dist = abs($x-$pt->[0]) + abs($y-$pt->[1]);
		if (!defined $mindist || $mindist > $dist) {
			$minpt = $i;
			$mindist = $dist;
		} elsif (defined $mindist && $mindist == $dist) {
			$minpt = undef;
		}
	}
	next if !defined $minpt;
	say "$x,$y closest to $minpt at $mindist";
	if ($y == $miny || $y == $maxy || $x == $minx || $x == $maxx) {
		$inf{$minpt}++;
		say "$minpt is infinite";
	} else {
		$count{$minpt}++;
	}
} }

my $maxarea;
for my $i (0 .. $#pts) {
	next if $inf{$i};
	$maxarea = $count{$i} if !$maxarea || $maxarea < $count{$i};
}

say $maxarea;
	
	
		
	
