'use strict';

var map = new Array(10);
for (var i = 0; i < map.length; ++i) {
	map[i] = new Array(10);
	for (var j = 0; j < map.length; ++j) {
		map[i][j] = 0;
	}
}

var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var inks = input.trim().split('\n');
for (var i in inks) {
	var ink = inks[i].trim().split(',');
	map[ink[1]][ink[0]] += 1;
	switch (ink[2]) {
		case 3:
			if (ink[1] - 2 >= 0) {
				++map[ink[0]][ink[1] - 2];
			}
			if (ink[1] + 2 < map[0].length) {
				++map[ink[0]][ink[1] + 2];
			}
			if (ink[0] - 2 >= 0) {
				++map[ink[0] - 2][ink[1]];
			}
			if (ink[0] + 2 < map.length) {
				++map[ink[0] + 2][ink[1]];
			}
		case 2:
			if (ink[1] - 1 >= 0 && ink[0] - 1 >= 0) {
				++map[ink[1] - 1][ink[0] - 1];
			}
			if (ink[1] - 1 >= 0 && ink[0] + 1 < map.length) {
				++map[ink[1] - 1][ink[0] + 1];
			}
			if (ink[1] + 1 < map[0].length && ink[0] - 1 >= 0) {
				++map[ink[1] + 1][ink[0] - 1];
			}
			if (ink[1] + 1 < map[0].length && ink[0] + 1 < map.length) {
				++map[ink[1] + 1][ink[0] + 1];
			}
		case 1:
			if (ink[1] - 1 >= 0) {
				++map[ink[0]][ink[1] - 1];
			}
			if (ink[1] + 1 < map[0].length) {
				++map[ink[0]][ink[1] + 1];
			}
			if (ink[0] - 1 >= 0) {
				++map[ink[0] - 1][ink[1]];
			}
			if (ink[0] + 1 < map.length) {
				++map[ink[0] + 1][ink[1]];
			}
			break;
	}
}

var zeroden = 0;
var maxden = 0;
for (var row in map) {
	for (var col in map[row]) {
		if (map[row][col] === 0) {
			++zeroden;
		} else if (map[row][col] > maxden) {
			maxden = map[row][col];
		}
	}
}
console.log(zeroden);
console.log(maxden);