import sys



board=[[0]*10 for i in range(10)]



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],]

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],]

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],]



size=[0,small,middle,large]



def isOnBoard(y,x):

    return 0<=y<10 and 0<=x<10



for line in sys.stdin.readlines():

    x,y,s=list(map(int,line.strip().split(",")))

    for i in range(-2,3):

        for j in range(-2,3):

            if isOnBoard(y+i,x+j):

                board[y+i][x+j]+=size[s][i+2][j+2]



print(len([j for i in board for j in i if j==0]))

print(max([i for j in board for i in j]))
import sys



board=[[0]*10 for i in range(10)]



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],]

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],]

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],]



size=[0,small,middle,large]



def isOnBoard(y,x):

    return 0<=y<10 and 0<=x<10



for line in sys.stdin.readlines():

    x,y,s=list(map(int,line.strip().split(",")))

    for i in range(-2,3):

        for j in range(-2,3):

            if isOnBoard(y+i,x+j):

                board[y+i][x+j]+=size[s][i+2][j+2]



print(len([j for i in board for j in i if j==0]))

print(max([j for i in board for j in i]))
import sys

board = [[0] * 10 for i in range(10)]
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],
]
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],
]
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],
]
size = [0, small, middle, large]


def isOnBoard(y, x):
    return 0 <= y < 10 and 0 <= x < 10


for line in sys.stdin.readlines():
    x, y, s = list(map(int, line.strip().split(",")))
    for i in range(-2, 3):
        for j in range(-2, 3):
            if isOnBoard(y + i, x + j):
                board[y + i][x + j] += size[s][i + 2][j + 2]
print(len([j for i in board for j in i if j == 0]))
print(max([i for j in board for i in j]))

import sys

board = [[0] * 10 for i in range(10)]
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],
]
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],
]
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],
]
size = [0, small, middle, large]


def isOnBoard(y, x):
    return 0 <= y < 10 and 0 <= x < 10


for line in sys.stdin.readlines():
    x, y, s = list(map(int, line.strip().split(",")))
    for i in range(-2, 3):
        for j in range(-2, 3):
            if isOnBoard(y + i, x + j):
                board[y + i][x + j] += size[s][i + 2][j + 2]
print(len([j for i in board for j in i if j == 0]))
print(max([j for i in board for j in i]))

-print(max([i for j in board for i in j])) +print(max([j for i in board for j in i]))