Special Number

Xem PDF



Tác giả:
Dạng bài
Ngôn ngữ cho phép
Assembly, Awk, C, C#, C++, Clang, Cobol, D, Groovy, Haskell, JS, Java, Kotlin, Lua, Node JS, OCaml, ObjectiveC, Output, PHP, Pascal, Perl, Prolog, Pypy, Pypy 3, Python, Ruby, Rust, Scala, Scratch, Swift
Điểm: 1900 Thời gian: 1.0s Bộ nhớ: 256M Input: bàn phím Output: màn hình

A number is special if the sum of its digits is a prime number. Given an integer \(N\), count the number of positive integer
pairs \((x, y)\) where both \(x\) and \(y\) are special and \(x + 2y = N\).

Input

  • The first line of input contains the one integer \(N (1 \le N \le 10^{15})\).

Output

  • Output a single number, the number of satisfied pairs.

Example

Test 1

Input
100
Output
7

Bình luận

Mới nhất
Tải bình luận...

Không có bình luận nào.