basic cost function for cards