
let _ = 
  let to_idx (x, y) = x * 10 + y in
  let drop a (x, y) s =
    let sl = [(0,0); (1,0); (0, 1); (-1,0); (0,-1)]
    and ml = [(1,1); (-1, 1); (-1,-1); (1,-1)]
    and ll = [(2,0); (0,2); (-2,0); (0,-2)] in
    let drop' lst = List.iter (fun (i, j) -> let x' = x + i and y' = y + j in if x' >= 0 && x' < 10 && y' >= 0 && y' < 10 then a.(to_idx (x',y')) <- a.(to_idx (x',y')) + 1 else ()) lst in
    match s with
    | 1 -> drop' sl
    | 2 -> drop' sl; drop' ml
    | 3 -> drop' sl; drop' ml; drop' ll
    | _ -> failwith "drop" in
  let ar = Array.make 100 0 in
  try while true do
        let ((x,y),s) = Scanf.scanf "%d,%d,%d\n" (fun x y s -> ((x,y),s)) in
        drop ar (x, y) s
      done
  with
    End_of_file -> Printf.printf "%d\n%d\n" 
                                 (Array.fold_left (fun n x -> if x = 0 then n + 1 else n) 0 ar)
                                 (Array.fold_left (fun m x -> if m > x then m else x) 0 ar)