#include <iostream>
#include <cstdio>

#define scanf scanf_s
#define SIZE 10

using namespace std;

int format[3][12][2] = { { { 0,1 },{ 1,0 },{ 0,-1 },{ -1,0 } },
						 { { 0,1 },{ 1,1 },{ 1,0 },{ 1,-1 },{ 0,-1 },{ -1,-1 },{ -1,0 },{ -1,1 } },
						 { { 0,1 },{ 1,1 },{ 1,0 },{ 1,-1 },{ 0,-1 },{ -1,-1 },{ -1,0 },{ -1,1 },{ 0,2 },{ 2,0 },{ 0,-2 },{ -2,0 } } };

int main() {
	int dx, dy, x, y, s, count, most, map[SIZE][SIZE], num[3] = { 4,9,12 };

	count = 100;
	most = 0;
	while (scanf("%d,%d,%d", &x, &y, &s)) {
		x--;
		y--;
		s--;

		for (int i = 0; i < num[s]; i++) {
			dx = x + format[s][i][0];
			dy = y + format[s][i][1];

			if (dx < 0 || dx >= SIZE || dy < 0 || dy >= SIZE) {
				continue;
			}

			map[dx][dy]++;
			if (map[dx][dy] == 1) {
				count--;
			}

			if (map[dx][dy] > most) {
				most = map[dx][dy];
			}
		}
	}

	cout << count << endl << most << endl;
	return 0;
}