function y=JJ(C)
   n=length(C);
   y=n+sum(C.*C-cos(2*pi*C));
end