def METHOD_NAME(self):
    p = self.p
    N = self.mesh.number_of_points()
    ldof = self.number_of_local_dofs()
    gdof = N
    if p > 1:
        NE = self.mesh.number_of_edges()
        gdof += (p-1)*NE
    if p > 2:
        NC = self.mesh.number_of_cells() 
        gdof += (ldof - 3*p)*NC 
    return gdof