#K85847. Uniqueness Score of Prime Factors

    ID: 36732 Type: Default 1000ms 256MiB

Uniqueness Score of Prime Factors

Uniqueness Score of Prime Factors

In this problem, you are given a single line of space-separated positive integers. For each integer, determine its prime factors and compute the total number of distinct prime factors across the entire list. In mathematical terms, if the input integers are (a_1, a_2, \dots, a_n) and for each (a_i) we define (PF(a_i)) as its set of prime factors, then you are to compute (|\bigcup_{i=1}^{n} PF(a_i)|). For example, if the input is "6 10 15", the prime factors are {2, 3} for 6, {2, 5} for 10, and {3, 5} for 15, and the union is {2, 3, 5} with size 3.

inputFormat

Input is read from standard input (stdin) and consists of a single line of space-separated integers.

outputFormat

Output to standard output (stdout) a single integer representing the uniqueness score, which is the number of distinct prime factors across all input integers.## sample

6
2