import std.stdio, std.string, std.conv;
import std.array, std.algorithm, std.range;

void main()
{
    immutable int[2][][4] w =
    [
        [[0,0]],
        [[1,0],[-1,0],[0,1],[0,-1]],
        [[1,1],[1,-1],[-1,1],[-1,-1]],
        [[2,0],[-2,0],[0,2],[0,-2]],
    ];
    immutable N=10;
    int[N][N] p;
    foreach(s;stdin.byLine())
    {
        auto m = s.split(",").map!(to!int);
        immutable x=m[0], y=m[1];
        foreach(i;0..m[2]+1)
            foreach(a; w[i])
            {
                immutable wx=x+a[0], wy=y+a[1];
                if(0<=wx && wx<N && 0<=wy && wy<N)
                    ++p[wx][wy];
            }
    }
    int z=0,m=0;
    foreach(a;p)
        foreach(v;a)
            if(v==0) ++z;
            else m=max(m,v);
    writeln(z);
    writeln(m);
}