calculate number of multiples