#include <cstdio>
#include <vector>
using namespace std;

typedef struct {
	int x, y;
}P;
vector<P> vs = {
	{0, -1}, { -1,0 }, { 0,0 }, { 0,1 }, { 1,0 }
};
vector<P> vm = {
	{-1,-1},{-1,0},{-1,1},{0,-1},{0,0},{0,1},{1,-1},{1,0},{1,1}
};
vector<P> vl = {
	{-2,0},{-1,-1},{-1,0},{-1,1},{0,-2},{0,-1},{0,0},{0,1},{0,2},{1,-1},{1,0},{1,1},{2,0}
};

bool ok(P p1, P p2) {
	int x = p1.x + p2.y;
	int y = p1.y + p2.y;
	return x >= 0 && x < 10 && y >= 0 && y < 10;
}

int s, p[10][10] = { 0 };
P c;

int main(){
	while (scanf("%d,%d,%d",&c.x, &c.y, &s) != EOF) {
		vector<P>::iterator itr = s == 1 ? vs.begin() : s == 2 ? vm.begin() : vl.begin();
		vector<P>::iterator e = s == 1 ? vs.end() : s == 2 ? vm.end() : vl.end();
		while (itr != e) {
			if (ok(c, *itr)) {
				p[c.x + itr->x][c.y + itr->y]++;
			}
			itr++;
		}
	}
	int sum = 0, b = 0;
	for (int i = 0; i < 10; i++) {
		for (int j = 0; j < 10; j++) {
			if (p[i][j] > 0) {
				sum++;
				if (p[i][j] > b) {
					b = p[i][j];
				}
			}
		}
	}
	printf("%d\n%d\n", sum, b);

	return 0;
}