#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
using namespace std;

int G[10][10];

void draw(int x, int y) {
  if(0<=x<10 && 0<=y<10) {
    G[y][x] ++;
  }
}

int main() {
  int a, b, c;

  fill(G[0], G[10], 0);
  
  while(scanf("%d,%d,%d", &a, &b, &c)) {
    draw(a, b);
    switch(c) {
    case 1:
      draw(a-1, b);
      draw(a+1, b);
      draw(a, b-1);
      draw(a, b+1);
    case 2:
      draw(a-1, b-1);
      draw(a+1, b-1);
      draw(a-1, b+1);
      draw(a+1, b+1);
    case 3:
      draw(a-2, b);
      draw(a+2, b);
      draw(a, b-2);
      draw(a, b+2);
      break;
    }
  }
  
  int clrNum = 0, mx=0;  
  
  for(int i=0; i<10; i++) {
    for(int j=0; j<10; j++) {
      mx = max(mx, G[i][j]);
    }
  }

  cout << mx << endl << clrNum << endl;
  
  return 0;
}