import std.stdio;
import std.string;
import std.conv;
import std.algorithm;
import std.range;
import std.container;
import std.bigint;
import std.math;

void main()
{
	auto are = new int[10][10];
	foreach (line; stdin.byLine) {
		auto a = line.split(",").map!(to!int);
		auto x = a[0];
		auto y = a[1];
		auto size = a[2];
		
		are[x][y]++;
		if (x-1 >= 0) are[x-1][y]++;
		if (x+1 < 10) are[x+1][y]++;
		if (y-1 >= 0) are[x][y-1]++;
		if (y+1 < 10) are[x][y+1]++;
		if (size == 1) continue;

		if (x-1 >= 0 && y-1 >= 0) are[x-1][y-1]++;
		if (x-1 >= 0 && y+1 < 10) are[x-1][y+1]++;
		if (x+1 < 10 && y-1 >= 0) are[x+1][y-1]++;
		if (x+1 < 10 && y+1 < 10) are[x+1][y+1]++;
		if (size == 2) continue;

		if (x-2 >= 0) are[x-2][y]++;
		if (x+2 < 10) are[x+2][y]++;
		if (y-2 >= 0) are[x][y-2]++;
		if (y+2 < 10) are[x][y+2]++;		 
	}

	int cnt, dmax;
	foreach (i; 0..10) {
		cnt += are[i].array.count(0);
		dmax = max(are[i].reduce!(max), dmax);
	}

	cnt.writeln;
	dmax.writeln;
}