Go: package main

import (
        "fmt"
)

var paper [10][10]int

func main() {
        var x, y, s int
        for {
                _, err := fmt.Scanf("%d,%d,%d", &x, &y, &s)
                if err != nil {
                        break
                }

                fill(x, y, s)
        }
        var d, z int
        for i := 0; i < 10; i++ {
                for j := 0; j < 10; j++ {
                        if paper[i][j] == 0 {
                                z += 1
                        }
                        if paper[i][j] > d {
                                d += 1
                        }
                }
        }
        fmt.Printf("%d\n%d\n", z, d)
}

func fill(x int, y int, s int) {
        paper[x][y] += 1
        if x > 0 {
                paper[x-1][y] += 1
        }
        if x < 9 {
                paper[x+1][y] += 1
        }
        if y > 0 {
                paper[x][y-1] += 1
        }
        if y < 9 {
                paper[x][y+1] += 1
        }

        if s >= 2 {
                if x > 0 && y > 0 {
                        paper[x-1][y-1] += 1
                }
                if x > 0 && y < 9 {
                        paper[x-1][y+1] += 1
                }
                if x < 9 && y > 0 {
                        paper[x+1][y-1] += 1
                }
                if x < 9 && y < 9 {
                        paper[x+1][y+1] += 1
                }
        }

        if s > 2 {
                if x > 1 {
                        paper[x-2][y] += 1
                }
                if x < 8 {
                        paper[x+2][y] += 1
                }
                if y > 1 {
                        paper[x][y-2] += 1
                }
                if y < 8 {
                        paper[x][y+2] += 1
                }
        }
}

C++: #include<iostream>
#include<string>
int mem[14][14] = {}, i = 0, X[50], Y[50], S[50];
int f(int a) {
	if (S[a] == 1) {
		mem[X[a] + 2][Y[a] + 2] += 1;
		mem[X[a] + 1][Y[a] + 2] += 1;
		mem[X[a] + 3][Y[a] + 2] += 1;
		mem[X[a] + 2][Y[a] + 1] += 1;
		mem[X[a] + 2][Y[a] + 3] += 1;
	}
	else if (S[a] == 2) {
		mem[X[a] + 2][Y[a] + 2] += 1;
		mem[X[a] + 1][Y[a] + 2] += 1;
		mem[X[a] + 3][Y[a] + 2] += 1;
		mem[X[a] + 2][Y[a] + 1] += 1;
		mem[X[a] + 2][Y[a] + 3] += 1;
		mem[X[a] + 1][Y[a] + 1] += 1;
		mem[X[a] + 1][Y[a] + 3] += 1;
		mem[X[a] + 3][Y[a] + 1] += 1;
		mem[X[a] + 3][Y[a] + 3] += 1;
	}
	else if (S[a] == 3) {
		mem[X[a] + 2][Y[a] + 2] += 1;
		mem[X[a] + 1][Y[a] + 2] += 1;
		mem[X[a] + 3][Y[a] + 2] += 1;
		mem[X[a] + 2][Y[a] + 1] += 1;
		mem[X[a] + 2][Y[a] + 3] += 1;
		mem[X[a] + 1][Y[a] + 1] += 1;
		mem[X[a] + 1][Y[a] + 3] += 1;
		mem[X[a] + 3][Y[a] + 1] += 1;
		mem[X[a] + 3][Y[a] + 3] += 1;
		mem[X[a]][Y[a] + 2] += 1;
		mem[X[a] + 4][Y[a] + 2] += 1;
		mem[X[a]][Y[a] + 4] += 1;
		mem[X[a] + 4][Y[a] + 2] += 1;
	}
	if (a == i)
		return 0;
	else
		return f(a + 1);
}
int main() {
	int x;
	char a;
	while (std::cin >> x, x) {
		X[i] = x;
		int y, s;
		std::cin >> a >> y >> a >> s;
		Y[i] = y, S[i] = s;
		i += 1;
	}
	f(0);
	int flag = 0, max = 0;
	for(int i=0;i<10;i+=1)
		for (int j = 0; j < 10; j += 1) {
			if (0 == mem[i + 2][j + 2])
				flag += 1;
			if (max < mem[i + 2][j + 2])
				max = mem[i + 2][j + 2];
		}
	std::cout << flag+1 << std::endl;
	std::cout << max << std::endl;
	return 0;
}

C++: #include<iostream>
#include<string>
int mem[14][14] = {}, i = 0, X[50], Y[50], S[50];
int f(int a) {
	if (S[a] == 1) {
		mem[X[a] + 2][Y[a] + 2] += 1;
		mem[X[a] + 1][Y[a] + 2] += 1;
		mem[X[a] + 3][Y[a] + 2] += 1;
		mem[X[a] + 2][Y[a] + 1] += 1;
		mem[X[a] + 2][Y[a] + 3] += 1;
	}
	else if (S[a] == 2) {
		mem[X[a] + 2][Y[a] + 2] += 1;
		mem[X[a] + 1][Y[a] + 2] += 1;
		mem[X[a] + 3][Y[a] + 2] += 1;
		mem[X[a] + 2][Y[a] + 1] += 1;
		mem[X[a] + 2][Y[a] + 3] += 1;
		mem[X[a] + 1][Y[a] + 1] += 1;
		mem[X[a] + 1][Y[a] + 3] += 1;
		mem[X[a] + 3][Y[a] + 1] += 1;
		mem[X[a] + 3][Y[a] + 3] += 1;
	}
	else if (S[a] == 3) {
		mem[X[a] + 2][Y[a] + 2] += 1;
		mem[X[a] + 1][Y[a] + 2] += 1;
		mem[X[a] + 3][Y[a] + 2] += 1;
		mem[X[a] + 2][Y[a] + 1] += 1;
		mem[X[a] + 2][Y[a] + 3] += 1;
		mem[X[a] + 1][Y[a] + 1] += 1;
		mem[X[a] + 1][Y[a] + 3] += 1;
		mem[X[a] + 3][Y[a] + 1] += 1;
		mem[X[a] + 3][Y[a] + 3] += 1;
		mem[X[a]][Y[a] + 2] += 1;
		mem[X[a] + 4][Y[a] + 2] += 1;
		mem[X[a]][Y[a] + 4] += 1;
		mem[X[a] + 4][Y[a] + 2] += 1;
	}
	if (a == i)
		return 0;
	else
		return f(a + 1);
}
int main() {
	int x;
	char a;
	while (1) {
		int y, s;
		std::cin >>x>> a >> y >> a >> s;
		Y[i] = y, S[i] = s;
		X[i] = x;
		if (s == 0)
			break;
		i += 1;
	}
	f(0);
	int flag = 0, max = 0;
	for (int i = 0; i < 10; i += 1)
		for (int j = 0; j < 10; j += 1) {
			if (0 == mem[i + 2][j + 2])
				flag += 1;
			if (max < mem[i + 2][j + 2])
				max = mem[i + 2][j + 2];
		}
	std::cout << flag+1 << std::endl;
	std::cout << max << std::endl;
	return 0;
}

C++: #include "bits/stdc++.h"
#include<unordered_map>
#pragma warning(disable:4996)
using namespace std;

struct ToUpper {
	char operator()(char c) { return toupper(c); }
};

int num[20][20];

int main() {
	memset(num, 0, sizeof(num));
	string st;
	while (getline(cin, st)) {
		int x = st[0] - '0';
		int y = st[2] - '0';
		x += 5;
		y += 5;
		int size = st[4] - '0';

		for (int i = 0; i < 20; ++i) {
			for (int j = 0; j < 20; ++j) {
				if (size == 1) {
					int lim = 2;
					int sa = abs(i - y) + abs(j - x);
					if (sa < lim)num[i][j]++;
				}
				else if (size == 3) {
					int lim = 3;
					int sa = abs(i - y) + abs(j - x);
					if (sa < lim)num[i][j]++;
				}
				else {
					if (abs(i - y) <= 1 && abs(j - x) <= 1)num[i][j]++;
				}
				
			}
		}
	}
	int a = 0;
	int b = 0;
	for (int i = 5; i < 15; ++i) {
		for (int j = 5; j < 15; ++j) {
			if (!num[i][j])a++;
			b = max(b, num[i][j]);
		}
	}
	cout << a <<endl<< b << endl;
	return 0;
}

C++: #include "bits/stdc++.h"

#define ALL(a) (a).begin(),(a).end()
#define SORT(c) sort((c).begin(),(c).end())
#define DESCSORT(c) sort(c.begin(), c.end(), greater<int>())

using namespace std;

using LL = long long int;
using LD = long double;

using pii = pair<int, int>;
using pll = pair<LL, LL>;
using pdd = pair<double, double>;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vl = vector<LL>;
using vvl = vector<vl>;
using vvvl = vector<vvl>;
using vd = vector<double>;
using vvd = vector<vd>;
using vs = vector<string>;
using vb = vector<bool>;
using vvb = vector<vb>;

const int INF = (1 << 30) - 1;
const LL INF64 = ((LL)1 << 62) - 1;
const double PI = 3.1415926535897932384626433832795;

const int dy[] = { 0, 1, 0, -1 };
const int dx[] = { 1, 0, -1, 0 };

int gcd(int x, int y) { return y ? gcd(y, x % y) : x; }
LL gcd(LL x, LL y) { return y ? gcd(y, x % y) : x; }

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);

	vvi m(14, vi(14));

	char ch;
	int x, y, s;
	while (cin >> x >> ch >> y >> ch >> s){
		y += 2;
		x += 2;

		m[y][x]++;
		m[y + 1][x]++;
		m[y - 1][x]++;
		m[y][x + 1]++;
		m[y][x - 1]++;

		if (s == 1) {
			continue;
		}

		m[y + 1][x + 1]++;
		m[y + 1][x - 1]++;
		m[y - 1][x + 1]++;
		m[y - 1][x - 1]++;

		if (s == 2) {
			continue;
		}

		m[y + 2][x]++;
		m[y - 2][x]++;
		m[y][x + 2]++;
		m[y][x - 2]++;
	}

	int noInkGrid = 0;
	int maxInc = 0;
	for (int i = 2; i < 12; i++) {
		for (int j = 2; j < 12; j++) {
			if (m[i][j] == 0) {
				noInkGrid++;
			}
			maxInc = max(maxInc, m[i][j]);
		}
	}

	cout << noInkGrid << endl;
	cout << maxInc << endl;
	return 0;
}