import std.algorithm, std.typetuple, std.stdio, std.string, std.conv;

immutable difs = [
    [[0, 0], [-1, 0], [0, -1], [1, 0], [0, 1]],
    [[0, 0], [-1, 0], [0, -1], [1, 0], [0, 1], [1, 1], [-1, -1], [1, -1], [-1, 1]],
    [[0, 0], [-1, 0], [0, -1], [1, 0], [0, 1], [1, 1], [-1, -1], [1, -1], [-1, 1], [-2, 0], [0, -2], [2, 0], [0, 2]],
];

void main()
{
    int[][] a = new int[][](10, 10);
    foreach(line;stdin.byLine)
    {
        auto input = line.split(",").map!(to!int);
        foreach(dif;difs[input[2] - 1])
        {
            int x = input[0] + dif[0],
                y = input[1] + dif[1];
            if(x < 0 || x >= 10) continue;
            if(y < 0 || y >= 10) continue;
            ++a[y][x];
        }
    }
    writeln(a.joiner.count(0), " ", a.joiner.reduce!max);
}