#include <iostream>
#include <algorithm>
using namespace std;
int dir[][2] = {{0, 0}, {1, 0}, {0, 1}, {1, 1}, {1, -1}, {-1, 1}, {-1, -1}, {2,
  0}, {0, 2}, {-2, 0}, {0, -2}};
int map[10][10], dens = 0, rest = 100;
void drop(int x, int y) {
  if (0 <= x && x < 10 && 0 <= y && y < 10) {
    if (map[x][y]++ == 0) rest--;
    dens = max(map[x][y], dens);
  }
}
int main() {
  for (int i = 0; i < 10; i++)
    for (int j = 0; j < 10; j++)
      map[i][j] = 0;
  int x, y, size;
  char c;
  while (cin >> x >> c >> y >> c >> size)
    for (int i = 0; i <= 4 * size; i++)
      drop(x + dir[i][0], y + dir[i][1]);
  cout << rest << endl << dens << endl;
}