#include<iostream>
#include<vector>
#include<string>

enum InkSize
{
	small=0,
	middle,
	large
};

InkSize Next(int x)
{
	if(x<0 || 2<x)
	{
		std::cout << "Input Error.\n";

		return small;
	}

	const InkSize ink[3]=
	{
	small,
	middle,
	large
	};

	return ink[x];
}

struct Board
{
	Board(int a)
	{
		for(size_t i=0; i<m_element; ++i)
		{
			for(size_t j=0; j<m_element; ++j)
			{
				m_map[j][i] = a;
			}
		}
	}
	
	void DropInk(int x, int y, InkSize ink)
	{
		const int inkSet[3][5][5]=
		{
			{//small
				{0,0,0,0,0},
				{0,0,1,0,0},
				{0,1,1,1,0},
				{0,0,1,0,0},
				{0,0,0,0,0},
			},
			{//middle
				{0,0,0,0,0},
				{0,1,1,1,0},
				{0,1,1,1,0},
				{0,1,1,1,0},
				{0,0,0,0,0},
			},
			{//large
				{0,0,1,0,0},
				{0,1,1,1,0},
				{1,1,1,1,1},
				{0,1,1,1,0},
				{0,0,1,0,0},
			}
		};

		for(size_t i=0; i<5; ++i)
		{
			for(size_t j=0; j<5; ++j)
			{
				if( y-2+i<0 || x-2+j<0 || y-2+i>9 || x-2+j>9 )
				{
					continue;
				}

				m_map[y-2+i][x-2+j] += inkSet[ink][i][j];
			}
		}
	}

	int CountNonInkedCell()
	{
		int count=0;

		for(size_t i=0; i<m_element; ++i)
		{
			for(size_t j=0; j<m_element; ++j)
			{
				if(m_map[i][j]==0)
				{
					++count;
				}
			}
		}

		return count;
	}

	int MostInkedCell()
	{
		int max=0;

		for(size_t i=0; i<m_element; ++i)
		{
			for(size_t j=0; j<m_element; ++j)
			{
				if(m_map[i][j]>max)
				{
					max=m_map[i][j];
				}
			}
		}

		return max;
	}

	enum { m_element = 10 };

	int m_map[m_element][m_element];
};

int main()
{
	Board boad1(0);

	int x=0, y=0, inkSize=0;

	char c;

	while(std::cin >> x >> c >> y >> c >> inkSize)
	{
		boad1.DropInk(x,y,Next(inkSize-1));
	}

	std::cout << boad1.CountNonInkedCell() << '\n' << boad1.MostInkedCell() << '\n';

}