Let C be a smooth curve embedded in a smooth quasi-projective three-fold Y, and let Q(C)(n) = Quot(n)(I-C) be the Quot scheme of length n quotients of its ideal sheaf. We show the identity (X) over tilde (Q(C)(n)) = (-1)(n)chi(Q(C)(n)), where (chi) over tilde is the Behrend weighted Euler characteristic. When Y is a projective Calabi-Yau three-fold, this shows that the Donaldson-Thomas ( DT) contribution of a smooth rigid curve is the signed Euler characteristic of the moduli space. This can be rephrased as a DT/ PT wall-crossing type formula, which can be formulated for arbitrary smooth curves. In general, such wall-crossing formula is shown to be equivalent to a certain Behrend function identity.