function F1(x,y){
xy[x][y-1]+=1;
xy[x-1][y]+=1;
xy[x][y]+=1;
xy[x+1][y]+=1;
xy[x][y+1]+=1;
}
function F2(x,y){
F1(x,y);
xy[x-1][y-1]+=1;
xy[x+1][y-1]+=1;
xy[x-1][y+1]+=1;
xy[x+1][y+1]+=1;
}
function F3(x,y){
F2(x,y);
xy[x][y-2]+=1;
xy[x-2][y]+=1;
xy[x+2][y]+=1;
xy[x][y+2]+=1;
}

var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var Arr=(input.trim()).split("\n");

var xy=[];
for(var i=0;i<10+4;i++){
   xy[i]=[];
   for(var j=0;j<10+4;j++){
      xy[i][j]=0;
   }
}

for(var i=0;i<Arr.length;i++){
   var arr=Arr[i].split(",").map(Number);
   var x=arr[0]+2;
   var y=arr[1]+2;
   if(arr[2]==1)F1(x,y);
   if(arr[2]==2)F2(x,y);
   if(arr[2]==3)F3(x,y);
}

var sum=0;
var max=0;
for(var i=2;i<10+2;i++){
   for(var j=2;j<10+2;j++){
      if(xy[i][j]==0)sum++;
      max=Math.max(max,xy[i][j]);
   }
}
console.log(sum);
console.log(max);