Sieve methods and class-number problems I