def Heron(p):
    d,n = 1,0
    while d > 10**(-p):
        d = 0.5*d*d
        n += 1
    return n