#!/usr/bin/perl -w

use v5.34;
use strict;

my @bots;
my $highest;
while (<>) {
	my ($x, $y, $z, $r) = /(-?\d+)/g;
	push @bots, [$x, $y, $z, $r];
	if (!$highest || $highest->[3] < $r) {
		$highest = [$x, $y, $z, $r];
	}
}

my ($x, $y, $z, $r) = @$highest;

my $in_range;
for my $bot (@bots) {
	$in_range++ if
		abs($bot->[0] - $x)
		+ abs($bot->[1] - $y)
		+ abs($bot->[2] - $z) <= $r;
}

say $in_range;
	

