#include<cstdio>
#include<algorithm>
using namespace std;
int main(){

  int ink[10][10]={};
  int dx3[4] = {-2,2,0,0};
  int dy3[4] = {0,0,-2,2};
  int dx2[4] = {-1,-1,1,1};
  int dy2[4] = {-1,1,-1,1};
  int dx1[4] = {-1,1,0,0};
  int dy1[4] = {0,0,-1,1};

  int x,y,s,p=100,ma=0;
  
  while(scanf("%d",&x) != EOF){
    scanf(",%d,%d",&y,&s);
    
    if(ink[y][x] == 0) p--;
    ink[y][x]++;
    ma = max(ma,ink[y][x]);
    if(s == 3){
      for(int i=0;i<4;i++){
	if(dy3[i]+y < 0 || dy3[i]+y >= 10 || dx3[i]+x < 0 || dx3[i]+y >= 10) continue;
	if(ink[ dy3[i]+y ][ dx3[i]+x ] == 0) p--;
	ink[ dy3[i]+y ][ dx3[i]+x ]++;
	ma = max(ma,ink[ dy3[i]+y ][ dx3[i]+x ]);
      }
    }
    if(s >= 2){
      for(int i=0;i<4;i++){
	if(dy2[i]+y < 0 || dy2[i]+y >= 10 || dx2[i]+x < 0 || dx2[i]+y >= 10) continue;
	if(ink[ dy2[i]+y ][ dx2[i]+x ] == 0) p--;
	ink[ dy2[i]+y ][ dx2[i]+x ]++;
	ma = max(ma,ink[ dy2[i]+y ][ dx2[i]+x ]);
      }
    }
    if(s >= 1){
      for(int i=0;i<4;i++){
	if(dy1[i]+y < 0 || dy1[i]+y >= 10 || dx1[i]+x < 0 || dx1[i]+y >= 10) continue;
	if(ink[ dy1[i]+y ][ dx1[i]+x ] == 0) p--;
	ink[ dy1[i]+y ][ dx1[i]+x ]++;
	ma = max(ma,ink[ dy1[i]+y ][ dx1[i]+x ]);
      }
    }
  }
  printf("%d\n%d\n",p,ma);
  return (0);
}