#include <iostream>
using namespace std;
int depth[11][11];
int dx[] = {0,  0,  0,  1, -1,  1,  1, -1, -1,  0,  0,  2, -2};
int dy[] = {0,  1, -1,  0,  0, -1,  1,  1, -1,  2, -2,  0,  0};
int ans;
int total;
void draw(int x, int y, int size){
	for(int i = 0; i < size*4+1; i++){
		int nx = x + dx[i];
		int ny = y + dy[i];
		if( nx < 0 || nx >= 10 || ny < 0 || ny >= 10) continue;
		depth[ny][nx]++;
		ans = max(ans, depth[ny][nx]);
		if(depth[ny][nx] == 1)total--;
	}
}
int main(){
	int x, y , size;
	char c;
	total = 10*10;
	while(cin >> x >> c >> y >> c >> size){
		draw(x,y,size);
	}
	cout << total << endl;
	cout << ans << endl;
	return 0;
}