The paper gives an identity for a sum of theta-series related to an imaginary quadratic field. This sum is expressed in terms of a certain Eisenstein series. The identity obtained is used in a new proof of the formula for the number of integral points in a system of ellipses. Such formulas are of interest because of their relations to the arithmetic Riemann–Roch theorem.