#include <stdio.h>
int main() {
    int RB[10][10],i,j,k;for (i=0;i<10;i++) for (j=0;j<10;RB[i][j++]=0);while (scanf("%d,%d,%d",&i,&j,&k)!=EOF) {
        RB[i][j]++;if (i) RB[i-1][j]++;if (i<9) RB[i+1][j]++;if (j) RB[i][j-1]++;if (j<9) RB[i][j+1]++;if (k>1) {if (i*j) RB[i-1][j-1]++;if (i<9 && j<9) RB[i+1][j+1]++;if (i && j<9) RB[i-1][j+1]++;if (i<9 && j) RB[i+1][j-1]++;} if (k==3) {if (i>1) RB[i-2][j]++;if (i<8) RB[i+2][j]++;if (j>1) RB[i][j-2]++;if (j<8) RB[i][j+2]++;}}
    for (i=0,k=100;i<10;i++) for (j=0;j<10;j++) if (RB[i][j]) k--;printf("%d\n",k);for (i=0,k=0;i<10;i++) for (j=0;j<10;j++) if (RB[i][j]>k) k=RB[i][j];printf("%d\n",k);return 0;}