__author__ = 'pborthelle'
import random

def children(c):
    a = ((c[0]-1, c[1]), (c[0], c[1]+1),
         (c[0]+1, c[1]), (c[0], c[1]-1))
    a = list(filter(lambda b: 0<=b[0]<31 and 0<=b[1]<31, a))
    random.shuffle(a)
    return a

def circle(center, radius):
    dists = {center:0}
    q = [center]
    for v in q:
        if dists[v] == radius:
            return tuple(dists.keys())
        for v2 in children(v):
            if not v2 in dists:
                dists[v2] = dists[v] + 1
                q.append(v2)

print(len(circle((5,5), 2)))