#include <iostream>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <string>
#include <cstring>
#include <climits>
 
#define REP(i,b,n) for(int i=b;i<n;++i)
#define REPR(i,b,n) for(int i=n-1;i>=b;--i)
#define CLR(mat) memset(mat, 0, sizeof(mat))
#define NCLR(mat) memset(mat, -1, sizeof(mat))
#define EACH(i, c) for(typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define BIT(n, b) ((n>>b) & 1)
#define PI acos(-1.0)

using namespace std;

static const double EPS = 1e-9;
typedef pair<int, int> pii;
typedef long long ll;

int sz[]={0, 5, 9, 13};
int dx[] = {0, 0, 0, 1, -1, 1, 1, -1, -1, 0, 0, 2, -2};
int dy[] = {0, 1, -1, 0, 0, 1, -1, 1, -1, 2, -2, 0, 0}; 
int fld[11][11]={{0}};
int cnt = 100;
int mx = 0;

bool inborder(int x, int y){
	return (x>=0&&x<10&&y>=0&&y<10);
}

int main(){

	int x, y, siz;
	char c;

	while(cin >> x >> c >> y >> c >> siz, !cin.eof()){
		
		for(int i=0; i<sz[siz]; i++){
			
			int nx = x+dx[i], ny = y+dy[i];
			
			if( inborder(nx, ny) ){
				
				if(fld[nx][ny]==0)
					cnt--;
				
				mx = max(mx, ++fld[nx][ny]);
			}
		}
	}
	
	cout << cnt << '\n' << mx << endl;

	return 0;
}