Let  S(d,c) = \sum_{j=1}^{c} (-1)^{j+1+\left\lfloor\frac{dj}{c}\right\rfloor} .

Show  S(d,c)+S(c,d) = 3 when  d,c have opposite parity and  (c,d)=1 .