Fix f(n,d)