#include <stdio.h>
#define TIMES 6

/* http://rose.u-aizu.ac.jp/onlinejudge/ProblemSet/description.jsp?id=0026&lang=jp */

int main(void)
{
	int paper[10][10] = {0} ;
	int blank = 0;
	int maxdk = 0;
	int x = 0 ;
	int y = 0 ;
	int size = 0 ;
	
	for ( ; i < TIMES ; i++ ){
	scanf("%d",&x) ;
	scanf(",%d",&y) ;
	scanf(",%d",&size) ;
	
	if(size >= 1){
		if (x+1<10)
			paper[x+1][y]++;
		if (x-1>=0)
			paper[x-1][y]++;
		if (y+1<10)
			paper[x][y+1]++;
		if (y-1>=0)
			paper[x][y-1]++;
		}
		
	if(size >= 2){
		if (x+1<10 && y+1<10)
			paper[x+1][y+1]++;
		if (x-1>=0 && y+1<10)
			paper[x-1][y+1]++;
		if (x-1>=0 && y-1>=0)
			paper[x-1][y-1]++;
		if (x+1<10 && y-1>=0)
			paper[x+1][y-1]++;
		}
		
	if(size >= 3){
		if (x+2<10)
			paper[x+2][y]++;
		if (x-2>=0)
			paper[x-2][y]++;
		if (y+2<10)
			paper[x][y+2]++;
		if (y-2>=0)
			paper[x][y-2]++;
		}
		
/*		printf("%d,",x); printf("%d,",y); printf("%d\n",size);	*/
		
		}
		
		
		for( y = 0 ; y < 10 ; y++ ){
			for( x = 0 ; x < 10 ; x++ ){
				if(paper[x][y] == 0)
				blank++;
				if(paper[x][y] > maxdk)
				maxdk = paper[x][y] ;
			}
		}
		
		printf("----------------\n");
		printf("BLANK:%d\n",blank);
		printf("MAX:%d\n",maxdk);
		
	return 0;
}