using System;

namespace _0026
{
    class Program
    {
        static void Main(string[] args)
        {
            int[,] fieldPaper = new int[10, 10];
            InitFieldPaper(fieldPaper);

            string inputString;

            while ((inputString = Console.ReadLine()) != null)
            {
                if (string.IsNullOrEmpty(inputString))
                {
                    break;
                }

                string[] inputs = inputString.Split(',');
                int dropX = int.Parse(inputs[0]);
                int dropY = int.Parse(inputs[1]);
                int dropSize = int.Parse(inputs[2]);

                DropInk(fieldPaper,dropX,dropY,dropSize);
            }
            Console.WriteLine("{0}", CountWhiteSquares(fieldPaper));
            Console.WriteLine("{0}", GetMaxDropStrength(fieldPaper));
        }

        public static int GetMaxDropStrength(int[,] fieldPaper)
        {
            int dropStrength = 0;

            for (int row = 0; row < 10; row++)
            {
                for (int coulmn = 0; coulmn < 10; coulmn++)
                {
                    if (fieldPaper[coulmn, row] > dropStrength)
                    {
                        dropStrength = fieldPaper[coulmn, row];
                    }
                }
            }
            return dropStrength;
        }

        public static int CountWhiteSquares(int[,] fieldPaper)
        {
            int whiteSquares = 0;

            for (int row = 0; row < 10; row++)
            {
                for (int coulmn = 0; coulmn < 10; coulmn++)
                {
                    if (fieldPaper[coulmn, row] == 0)
                    {
                        whiteSquares++;
                    }
                }
            }
            return whiteSquares;
        }

        public static void InitFieldPaper(int[,] fieldPaper) 
        {
            for (int i = 0; i < fieldPaper.Length ;i++ )
            {
                fieldPaper[(i / (int)Math.Sqrt(fieldPaper.Length)), (i % (int)Math.Sqrt(fieldPaper.Length))] = 0;
            }
        }

        public static void DropInk(int[,]fieldPaper,int dropX, int dropY, int dropSize) 
        {
            switch (dropSize)
            {
                case 3:
                    if (dropY - 2 >= 0)
                        fieldPaper[dropY - 2, dropX] += 1;
                    if (dropX - 2 >= 0)
                        fieldPaper[dropY, dropX - 2] += 1;

                    for (int i = dropX - 1; i <= dropX + 1; i++)
                    {
                        for (int j = dropY - 1; j <= dropY + 1; j++)
                        {
                            if (i >= 0 && j >= 0 && i <= 9 && j <= 9)
                                fieldPaper[j, i] += 1;
                        }
                    }

                    if (dropY + 2 <= 9)
                        fieldPaper[dropY + 2, dropX] += 1;
                    if (dropX + 2 <= 9)
                        fieldPaper[dropY, dropX + 2] += 1;

                    break;
                case 2:
                    for (int i = dropX - 1; i <= dropX + 1; i++)
                    {
                        for (int j = dropY - 1; j <= dropY + 1; j++)
                        {
                            if (i >= 0 && j >= 0 && i <= 9 && j <= 9)
                                fieldPaper[j, i] += 1;
                        }
                    }

                    break;
                case 1:

                    if (dropY - 1 >= 0)
                        fieldPaper[dropY - 1, dropX] += 1;
                    if (dropX - 1 >= 0)
                        fieldPaper[dropY, dropX - 1] += 1;
                        fieldPaper[dropY, dropX] += 1;
                    if (dropY + 1 <= 9)
                        fieldPaper[dropY + 1, dropX] += 1;
                    if (dropX + 1 <= 9)
                        fieldPaper[dropY, dropX + 1] += 1;
                    break;
            }
        }
    }
}

Measured memory_bytes: 5584