#include "bits/stdc++.h"

#define REP(i,num) for(int i=0;i<(num);++i)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto& x:c){cout<<x<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=int>
T in(){T x; cin >> x; return (x);}
template<typename T=int,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

int main(){
	//cin.tie(0);
	//ios::sync_with_stdio(false);

	vector<vector<int>> P(10,vector<int>(10,0));
	vector<vector<pair<int,int>>> F(3);
	F[0] = {make_pair(0,-1),make_pair(-1,0),make_pair(0,0),make_pair(1,0),make_pair(0,1)};
	F[1] = {make_pair(-1,-1),make_pair(0,-1),make_pair(1,-1),make_pair(-1,0),make_pair(0,0),
		    make_pair(1,0),make_pair(-1,1),make_pair(0,1),make_pair(1,1)};
	F[2] = {make_pair(0,-2),make_pair(-1,-1),make_pair(0,-1),make_pair(1,-1),
		    make_pair(-2,0),make_pair(-1,0),make_pair(0,0),make_pair(1,0),make_pair(2,0),
		    make_pair(-1,1),make_pair(0,1),make_pair(1,1),make_pair(0,2)};
	string S;
	while(cin>>S){
		int x,y,s;
		sscanf(S.c_str(),"%d,%d,%d",&x,&y,&s);
		s--;
		for(int i=0,ei=F[s].size();i<ei;i++){
			int nx = x+F[s][i].first,ny = y+F[s][i].second;
			if(0<=nx && nx<10 && 0<=ny && ny<10){
				P[ny][nx]++;
			}
		}
	}
	int num=0,dep=0;
	REP(i,10){
		REP(j,10){
			if(P[i][j]==0) num++;
			dep = max(dep,P[i][j]);
		}
	}
	out(num);
	out(dep);
	return 0;
}
