#C7496. Sum of Digits is Prime

    ID: 51373 Type: Default 1000ms 256MiB

Sum of Digits is Prime

Sum of Digits is Prime

Given a positive integer ( n ), your task is to determine whether the sum of its digits is a prime number. Let the digits of ( n ) be ( d_1, d_2, \dots, d_k ). Compute the sum ( S ) as follows:

[ S = d_1 + d_2 + \cdots + d_k ]

A number is prime if it is greater than 1 and has no positive divisors other than 1 and itself. You need to check this condition for ( S ) and output the boolean result accordingly.

Example:
If ( n = 123 ), then ( S = 1 + 2 + 3 = 6 ), and since 6 is not prime, the answer is False.

inputFormat

The input consists of a single line containing a positive integer ( n ). Input is provided via standard input (stdin).

outputFormat

Output True if the sum of the digits of ( n ) is a prime number, otherwise output False. The output should be written to standard output (stdout).## sample

123
False

</p>