def drop(x,y):

    global paper

    if 0<=x<10 and 0<=y<10: paper[y][x]+=1

    return



def ink(x,y,size):

    drop(x,y)

    drop(x-1,y)

    drop(x+1,y)

    drop(x,y-1)

    drop(x,y+1)

    if size==1: return

    drop(x-1,y-1)

    drop(x-1,y+1)

    drop(x+1,y-1)

    drop(x+1,y+1)

    if size==2: return

    drop(x-2,y)

    drop(x+2,y)

    drop(x,y-2)

    drop(x,y+2)

    return



paper = [[0 for i in range(10)] for j in range(10)]

while True:

    try:

        x,y,size = list(map(int, input().split(",")))

        ink(x,y,size)

    except:

        break



print(sum([e.count(0) for e in paper]))

print(max([max(e) for e in paper]))
import sys

def ink(x,y,size):

    global paper

    paper[y][x]+=1

    for d in [-1,1]:

        paper[y+d][x]+=1

        paper[y][x+d]+=1

    if size==1: return

    for d in [-1,1]:

        paper[y+d][x+d]+=1

        paper[y+d][x-d]+=1

    if size==2: return

    for d in [-2,2]:

        paper[y+d][x]+=1

        paper[y][x+d]+=1

    return



R=list(range(14))

paper=[[0 for i in R] for j in R]

for s in sys.stdin:

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

    ink(x+2,y+2,size)

c=0

m=0

for e in paper[2:-2]:

    x=e[2:-2]

    c+=x.count(0)

    m=max(max(x),m)

print(c)

print(m)
def drop(x, y):
    global paper
    if 0 <= x < 10 and 0 <= y < 10:
        paper[y][x] += 1
    return


def ink(x, y, size):
    drop(x, y)
    drop(x - 1, y)
    drop(x + 1, y)
    drop(x, y - 1)
    drop(x, y + 1)
    if size == 1:
        return
    drop(x - 1, y - 1)
    drop(x - 1, y + 1)
    drop(x + 1, y - 1)
    drop(x + 1, y + 1)
    if size == 2:
        return
    drop(x - 2, y)
    drop(x + 2, y)
    drop(x, y - 2)
    drop(x, y + 2)
    return


paper = [[0 for i in range(10)] for j in range(10)]
while True:
    try:
        x, y, size = list(map(int, input().split(",")))
        ink(x, y, size)
    except:
        break
print(sum([e.count(0) for e in paper]))
print(max([max(e) for e in paper]))

import sys


def ink(x, y, size):
    global paper
    paper[y][x] += 1
    for d in [-1, 1]:
        paper[y + d][x] += 1
        paper[y][x + d] += 1
    if size == 1:
        return
    for d in [-1, 1]:
        paper[y + d][x + d] += 1
        paper[y + d][x - d] += 1
    if size == 2:
        return
    for d in [-2, 2]:
        paper[y + d][x] += 1
        paper[y][x + d] += 1
    return


R = list(range(14))
paper = [[0 for i in R] for j in R]
for s in sys.stdin:
    x, y, size = list(map(int, s.split(",")))
    ink(x + 2, y + 2, size)
c = 0
m = 0
for e in paper[2:-2]:
    x = e[2:-2]
    c += x.count(0)
    m = max(max(x), m)
print(c)
print(m)

-def drop(x, y): +import sys + + +def ink(x, y, size): -    if 0 <= x < 10 and 0 <= y < 10: -        paper[y][x] += 1 +    paper[y][x] += 1 +    for d in [-1, 1]: +        paper[y + d][x] += 1 +        paper[y][x + d] += 1 +    if size == 1: +        return +    for d in [-1, 1]: +        paper[y + d][x + d] += 1 +        paper[y + d][x - d] += 1 +    if size == 2: +        return +    for d in [-2, 2]: +        paper[y + d][x] += 1 +        paper[y][x + d] += 1 -def ink(x, y, size): -    drop(x, y) -    drop(x - 1, y) -    drop(x + 1, y) -    drop(x, y - 1) -    drop(x, y + 1) -    if size == 1: -        return -    drop(x - 1, y - 1) -    drop(x - 1, y + 1) -    drop(x + 1, y - 1) -    drop(x + 1, y + 1) -    if size == 2: -        return -    drop(x - 2, y) -    drop(x + 2, y) -    drop(x, y - 2) -    drop(x, y + 2) -    return - - -paper = [[0 for i in range(10)] for j in range(10)] -while True: -    try: -        x, y, size = list(map(int, input().split(","))) -        ink(x, y, size) -    except: -        break -print(sum([e.count(0) for e in paper])) -print(max([max(e) for e in paper])) +R = list(range(14)) +paper = [[0 for i in R] for j in R] +for s in sys.stdin: +    x, y, size = list(map(int, s.split(","))) +    ink(x + 2, y + 2, size) +c = 0 +m = 0 +for e in paper[2:-2]: +    x = e[2:-2] +    c += x.count(0) +    m = max(max(x), m) +print(c) +print(m)